0

Well, by assigning events or putting values or whatever we want to do to certain elements..

For ID we use:

$("#id").addClass("something");

For Class we use:

$(".class").addClass("something");

What about for Name?

Any help would be appreciated.

Can't find any certain solutions for this or I just didn't know the right words to search for haha.

2

1 Answer 1

2

You use the generic selector for an attribute:

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

jQuery reference here: http://api.jquery.com/attribute-equals-selector/

Sign up to request clarification or add additional context in comments.

1 Comment

You mean $("[name='xxx']") ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.