?
Solved

JQuery Get/Find form button using text value

Posted on 2013-01-17
1
Medium Priority
?
338 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
[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
1 Comment
 
LVL 82

Accepted Solution

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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

752 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