I need a function to select all elements with a custom attribute, and take its name and value. for example:
<input type="text" my:name="koni" my:age="20" my:city="New York" />
Note that my is always the same, but that behind not. in my function i then want to say:
var attr = //here should be the attribute (attr, or attr2)
and
var value = //here should be the value (test, or hello)
how can i make that?
Edit: sorry, forgot to paste the html.
i want to loop throu each input that has such custom my attributes, and get the value and the key in an array. for this example, i should have:
key = name, value = koni
and
key = age, value = 20
...