-1

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 ?

1

2 Answers 2

2

Use the attribute="value" selector:

$('[name="xxx"]')
Sign up to request clarification or add additional context in comments.

Comments

0

Yes you can.

Use something like :

  $('[name="xxx"]').prop('readonly', true);

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.