JavaScript check field value based on variable value
- by Nikita Sumeiko
I have an anchor like this:
<a href="#" rel="1 4 7 18 ">Anchor</a>
Where 'rel' attribute values are ids of some items.
Than I have a form with an input, where user should type an id and click submit button.
On submit button click I need to check the value of input like this:
var value = $('a').attr('rel');
if ( value == '1' || value…