Solved

jquery get button through value

Posted on 2013-01-09
5
249 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

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.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Suggested Courses
Course of the Month10 days, 13 hours left to enroll

632 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