jquery - Is there a way to select an input of the parent form as a child with id specified? -


O people, quick question,

I have an ID that applies to me several times Pages have been done (I used many duplicate IDs because I also apply a class that determines whether the icon is a fixed color instead of copying ID CSS for each button color). I am using a jquery form handler which starts on form submission and I would like to add an attribute on the submit button, but since there is a button on another page on the same ID, I am having difficulty working on it Is there a way to choose the input of the id as a parent? For example (I know this is wrong, but I want to get this case in this example)

 

id attribute in an HTML document.

To answer your question, you can use or selector reference :

  // Selector reference, the current element supply as the second element: $ ("# buttonid", this) .attr ({disabled: true, value: "sent ... "}); // find () $ (this) .find (" # buttonID ") atr ({disabled: true, value:" sending ... "});  

Comments