Alex Rivera | Logout

how to find buttons with specified text inside using jquery?

Asked 2009-11-18T10:18:09.850
23

I have this code structure , and i want to search for span that has text "Refund Offline" and then add the class hide_button to the parent tag " button".

basically I want to hide the button that has "Refund Offline" text.

<button class="scalable save submit-button" type="button" id="id_b5295d98b1d6eb3012e2dfd801ede120">

<span>Refund Offline</span>

</button>

Using jQuery

thanks in advance

Edit
Report

1 Answer

1
$('button span').each ( function() {
    if($(this).text() === "Refund Offline" )
    {
        $(this).parent().addClass ( 'hide_button' );
    }
});
answered 2009-11-18T10:22:18.657

Your Answer