Im Looking for a way to search for a string inside a text and get the value behind it. Sorry, I am very bad at JS.
The text I'm using:
<label for="sample-group-15822160-0"><br>
<input name="sample-group-15822160" id="sample-group-15822160-0" value="option-1" numbercount="1" type="radio" checked="checked">Option 1</label>
What I need: 1
-> So just the value from the numbercount field inbetween the ".
What I tried:
var numhelper = sampleButtonObjects[index].outerHTML;
var numhelperNum = ico1helper.split('numbercount="')[0].split('"')[1].trim();
var num = numhelperNum ;
What I received: sample-group-15822160-0 (the ID).
Can somebody please tell me, what I'm doing wrong? Thank you!
numbercountattribute directly? Seems like an XY Problem.