1

I'm looking to hide a button containing the text 'Buy Now' using jQuery. This button is within a containing div.

Basically something like this:

$("button contains('Buy Now').parent('div').hide();

1 Answer 1

6

You mean this:

API: http://api.jquery.com/contains-selector/

Hope it fits the cause, :) OR http://jsfiddle.net/DDv8a/ try this demo

code

$("button:contains('Buy Now')").parent('div').hide();

or

$(document).ready(function () {
   $("input[value='Buy Now']").closest('div').hide();
});

Sign up to request clarification or add additional context in comments.

6 Comments

lol @Hogan I will buy you a pint and best coffee in the world - also :) this favour will be remembered bruv :) and shall be returned with awesomeness!
Yo yo @Raminson < Boom > and here is your entry for today!! :) howsz things
@FrançoisWahl Wassup bruv, howz life innit! indeed seems like :)
With a rep like that, you might hit 9,999 - that gets briefly annoying ;-)
@Neil yeah I really need to take that screen shot of 9999 :) it will go into my wall, 'n you will be shout-ed with a cup of kopi luak :) if we ever met!
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.