Sunday, 6 November 2016

Can i use name of element in javascript even?




Can i use name of element in javascript even ?



for use id="xxx" , we use



$('#xxx').prop('readonly', true);



And for class="xxx" , we use



$('.xxx').prop('readonly', true);


I want to know can we use name="xxx" in javascript even ?


Answer



Use the attribute="value" selector:



$('[name="xxx"]')


No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...