I want to hide the following <div>
in my site pages, but this <div>
is changing its position dynamically, so I cannot use the code $("div:eq(0)").hide();
<div style="background: #ebebeb; border-top: 1px solid #ccc; border-right: 1px solid #ccc;
border-left: 1px solid #ccc; padding: 5px; font-size: 12px; position: fixed; right: 3%;
bottom: 0px; -webkit-border-radius: 3px 3px 0px 0px; border-radius: 3px 3px 0px 0px;">
Powered by <a href="http://bizmate.in">Bizmate</a></div>
Any suggestions on how can I hide that element?
Firstly, you really should not put all of those styles inline. It clutters your html, and is poor design since you are mixing styling and layout. It would be better to take it out, use css selectors and wrap it in
<style></style>
tags; to that end you should also add a class to the<div>
to make these selections easier to carry out and more maintainable.That being said, the following function using
.filter()
will do what you want…You can try this
$('div a[href="http://bizmate.in"]').parent().hide();
should work.Demo: http://jsfiddle.net/C4pYy/
Why not add an id and then use
$('div#myId').hide()
?try
Assume in the parent elements of given html, you can find one with id=”container”, this will ensure the right is found with that container rather than else where since a link like that is pretty common.
I think you’ll have to assign an ID to it, and if you can’t, why not?
Here’s code for hiding it anyways:
JSfiddle-example
Code for hiding with id, without id, and from what your link content is:
http://jsfiddle.net/9eLAJ/3/