Solved

jquery get button through value

Posted on 2013-01-09
5
243 Views
Last Modified: 2013-01-10
Hi,

I've been searching on how to find a button (button tags) using only it's value.

$('input[value="'+getAlignment(node)+'"]').addClass("active");

Open in new window


This code doesn't seem to work (getAlignment function is correct as I checked it thourgh debugger). Doesn't input recognize button tags?
0
Comment
Question by:Mutsop
  • 2
  • 2
5 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 38761450
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 38761469
Doesn't input recognize button tags?
Is it an input, or is it a button? There are two ways to create a button in HTML (well, technically 3 if you count a submit button):

<input type="button"></input>
<button></button>

Open in new window


So which are you using? A JQuery of $('input') will not find a <button> tag.
0
 
LVL 3

Author Comment

by:Mutsop
ID: 38762238
it's a <button> I need to have.
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 38762684
Then swap "input" for "button" in your JQuery.
0
 
LVL 3

Author Closing Comment

by:Mutsop
ID: 38765390
wasn't expecting it to be that easy -.- Thanks! :D
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question