Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

Html: how can I hide this line untl a certain event occurs

how can I hide this line untl a certain event occurs

<a id="ExpColLink" href="javascript:showOrHide('ExpColLink');"> <p class="slide" align="center"><font size="1">Select a listing & click here to View Map</font></p></a>

----- I have no way of excuting this function??

<script type="text/javascript">
 function show()
   {
       if (window.location.href.indexOf("RecordID")>0)
       {
document.getElementById("show").style.display = "block";
alert("your url contains the name RecordID");

       }      
     
   };
</script>
0
westdh
Asked:
westdh
1 Solution
 
Tom BeckCommented:
How about on page load?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled</title>
<style type="text/css">
</style>
</head>
<body onload="javascript:showOrHide('ExpColLink');">
<a id="ExpColLink" href="javascript:showOrHide('ExpColLink');"> <span class="slide" style="text-align:center;font-size:1em">Select a listing & click here to View Map</span></a>
<script language="JavaScript" type="text/javascript">
 function showOrHide(ele) 
   {
       if (window.location.href.indexOf("RecordID")>0) 
       {
            document.getElementById(ele).style.display = "block";
            alert("your url contains the name RecordID");
       } 
       else 
       {
            document.getElementById(ele).style.display = "none";
       }      
      
   }
</script>
</body>
</html>

Open in new window

0
 
westdhAuthor Commented:
Thanks
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now