Link to home
Start Free TrialLog in
Avatar of Mutsop
MutsopFlag for Belgium

asked on

jquery get button through value

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?
Avatar of leakim971
leakim971
Flag of Guadeloupe image

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.
Avatar of Mutsop

ASKER

it's a <button> I need to have.
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mutsop

ASKER

wasn't expecting it to be that easy -.- Thanks! :D