Evertjan.
2/10/2015 7:32:00 PM
"Mel Smith" <syntel@cox.net> wrote on 10 feb 2015 in comp.lang.javascript:
> Hi:
>
>
> IE and Chrome both 'hide' the <div> below when a user 'clicks' on
> the
> button.
>
> However, an automatically updated version of FF does NOT .
>
> That is, when a user 'clicks' on the 'Hide Me' button, nothing
> happens.
> Very few (any ??) of my users have FF installed, and I very seldom use
> FF. But month ago, I *believe* it worked correctly -- but I'm not sure.
>
> Question:
>
> What FF setting could I have (somehow) set wrongly such that
> 'onclicks'
> were not acted on.
>
> TIA for any hints. Again, IE and Chrome work correctly
>
> -Mel Smith
>
> **** my html and ES/JS code below ******
> <div id="inotice">
> <input type="button" onclick="hidenotice();" value="Hide Me" />
> <!-- lots of text and <br> here -->
> </div>
>
> function hidenotice() {
> var el=document.getElementById("inotice");
> el.style.display="none";
>}
Works fine here also in FF.
==============
I would use a more general solution for the function,
if the <input> is a always direct child:
<script type='text/javascript'>
function hideParent(x) {
x.parentNode.style.display = "none";
};
</script>
<div>
<input type="button" onclick="hideParent(this);" value="Hide Parent">
lots of text and <br> here
</div>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)