Solved

JQuery Get/Find form button using text value

Posted on 2013-01-17
1
304 Views
Last Modified: 2013-01-17
Hello,

If I have the following button in my page

<input type="button" class="btn" value="Find"  />

This button is loaded from a 3rd party application and does not have an id.
If it did have an id (e.g. "testb") I could use something like the following to find my button and set it's background image

$('[id$="testb"]').css("background-image", "url(http:www.mytest.com/myTest.jpg)");

However my button will never have an id and there is also the possibility that more than one button on the page therefore I can't search by class or type.

Can I search using the value"Find" as this will be unique?

Thanks in advance.
0
Comment
Question by:speedygonzalez
1 Comment
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
Try this :
$(':button[value="Find"]').css("background-color", "red");
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to dynamically set the form action using jQuery.
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now