javascript - Jquery, getting back list of ID strings of all elements with ID's that "begin with" a string? -
I'm not a Javascript guru because I work more server-side so I'm struggling with this. I have come to know how to do this. Actually, I have a series of elements that have the ID "string" starts with "tagRow_" and I need to get back a list of the actual element ID because I do not need the element only but the element ID too It is as if I have to parse the unique end to each on the server side to determine how it corresponds.
Let me get all the elements The codes given below have been found, but I'm not sure as far as the list is returning or what, anybody can give advice on how to return the list of string ID names, Thank you
Edit: I really need to do this with a radio input field, by mistake I put a DIV in my example, for a DIV Works fine But like one of the following is not working properly for a radio input:
& lt; input id = "tagrovo_dade" type = "radio" value = "h "& Gt; & lt; input id =" tagRow_ddd "type =" radio "value =" p "& gt; & Lt; Input id = "tagRow_ddd" type = "radio" value = "r" & gt; & Lt; Input id = "tagRow_ddd" type = "radio" value = "c" & gt; $ ("Input [id =" tagRow_ '] "). Each (function () {var id = this.id, idNumber = id.replace (/ \ D + /,' '); document.body.innerHTML + IdNumber + '
Miscellaneous Elements = []; $ (" Div [id = "tagRow_ ']"). Each (function () {elements.push (this.id);}); Var stringOfElementIDs = Elements String ();
Comments
Post a Comment