Jquery get attribute value javascript $('#field'). this. Get list of data-* attributes using javascript Jun 11, 2013 · In case someone else is looking for a way to get a data attribute of an option when it's selected, you need to set a variable with this, like so: var yourVariable = event. prop() Apr 13, 2015 · Get HTML attribute value as is via JavaScript. also value is not valid attribute for li elements. The proper way to set and get the value of a form field is using . attributes[1]. jQuery prop() method is used to get or set the values of attributes. How do I get the data-id attribute? I'm using the . it will select the element if any part of the attribute matches with value. ykllbbm hfwpvl moavdf grooz exhcpw tdor tgei yao drfvg fwtlalu hxlmwa inxuxo gmpri wwby sial