search for src filename using jQuery


I have this bit of code and I need to dynamically change some CSS on a paypal button. How do I search for the source filename in this part:

<input type="image" src="" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">

Open in new window

So I'm looking for the input type='image' where src=''

Thank you!
Victor KimuraSEO, Web DeveloperAsked:
Who is Participating?
GaryConnect With a Mentor Commented:
If all you want to do is remove the border on the paypal button then just use

$("input[src='']").css({"border": "0"});
This would get the object, what you do with it then is upto you
Victor KimuraSEO, Web DeveloperAuthor Commented:
I tried this:

var inputTypes = [];

                $('p#encypted_ppbtn input').each(function(){

                    var sCurSrcVal= $(this).attr(src);

                    if ( sCurSrcVal == "" ) {

                        $(this).css({"border": "0"});



Open in new window

But it's failing at:
 var sCurSrcVal= $(this).attr(src);

How come?
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Think you missed my comment above. Here's an example to change the src
Victor KimuraSEO, Web DeveloperAuthor Commented:
Oh, I forgot the quotes:

var sCurSrcVal= $(this).attr('src');

Victor KimuraSEO, Web DeveloperAuthor Commented:
oh, that's much easier. Thanks, Cathal! =)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.