Yuri Boyz
asked on
Hide buttons having dynamic id's on page loads
I have dynamically generated buttons which have ids like
The structure of button is as folows
On page load I want to hide all the buttons which have id's as above or by using the data-target="dialog-messag e' property.
There can be 2 buttons or 4 or 6 or whatever.
Need jQuery code help for this
Thanks
id='modalButton-1'
id='modalButton-2'
id='modalButton-3'
id='modalButton-4'
id='modalButton-5'
The structure of button is as folows
<button class="abc" data-target="dialog-message" value="0" id="modalButton-2">Add</button>
On page load I want to hide all the buttons which have id's as above or by using the data-target="dialog-messag
There can be 2 buttons or 4 or 6 or whatever.
Need jQuery code help for this
Thanks
ASKER
No I dont want to use class. It is used for some other purpose.
Ok may be can try this way
$('button').each(function() {
//alert();
if($(this).is(':contains("modalButton")'))
{
$(this).hide();
}
})
Sample fiddle for the above code https://jsfiddle.net/bnhuLdgf/3/
ASKER
In your code you have not used id's: id="modalButton-1", id="modalButton-2",
Without these id this is useless for me.
Without these id this is useless for me.
How many Id's you have?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks,
you are welcome :)
Open in new window