Link to home
Start Free TrialLog in
Avatar of jwright9
jwright9

asked on

How can I use html:link to run only a JavaScript function?

I am trying to hide a div "chunk" using an html-el:link tag but its not working.  I'm setting the page attribute equal to the page in which the div is located.  I'm just getting a "page not found" error.  Can someone tell me how to hide the div section using the link without getting the error page?

Thanks to all of you good souls!
function hideCriteriaSubTotals() {
	alert("Point1");
	document.getElementById("criteriaSubtotals").style.display="none";
	
	alert("Point2");
}
 
<html-el:link page="/jsp/pendingTotalsReport.jsp" onclick="hideCriteriaSubTotals();" >
       Hide Criteria Subtotals
</html-el:link>
 
<div id="criteriaSubtotals">		
       CriteriaSubtotal goes here.			
</div>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of sybe
sybe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jwright9
jwright9

ASKER

Thanks!  I found that
<html-el:link href="javascript:hideCriteriaSubTotals();">
   Hide Criteria Subtotals
</html-el:link>

Works.
Thanks for the alternative answer sybe!