I’m attempting a hide show toggling script using jquery. The name of the label is passed into the jquery script and the id of the information is used to trigger a hide show. works great in IE but i can’t get it in safari. the onclick returns undefined.
<span id="fontlabel" name="fontinfo" style="cursor:pointer; color:#06C;"
onclick="showfont(this.name)">Font List for Input</span>
<span id="stagenamefont" class="fontsettings"> ...stuff...</span>
function showfont(name)
{
if($('#'+name).is(':visible')== false)
{
$('#'+name).show();
}else{
$('#'+name).hide();
}
}
You’re using jQuery. Let’s do this the right way:
HTML
JavaScript
Demo http://jsfiddle.net/mattball/dzrJg/