Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cursor pointer in html <area> tag

Tags:

html

css

I have a jsp like this

<%@ include file="commonheader.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script type="text/javascript">
function passValue(stateid,cityid)
{
if(cityid=="0")
{
    document.forms["test"].action="locator/city.jsp"
    document.forms["test"]["stateid"].value=stateid;
    document.forms["test"].submit();
}
else
{   
    document.forms["test"].action="locator/area.jsp"
    document.forms["test"]["stateid"].value=stateid;
    document.forms["test"]["cityid"].value=cityid;
    document.forms["test"].submit();
}
}
</script>
</head>

<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<div align="center">     
<table width="70%" border="0">
<tr>
<td width="80%" align="center"><img src="images/map.jpg" width="550" height="500" border="0" usemap="#Map">
<form id="test" name="test" method="post">
<input type="hidden" name="stateid" />
<input type="hidden" name="cityid"/>       
<map name="Map">
<area shape="rect" coords="81,291,180,305" alt="Maharashtra" onclick="passValue('15','0') />
</map>
</form>
</td>
</tr>
</table>
</div>
</body>
</html>

Form is getting submitted and the values are getting passed correctly. But the problem here is the cursor is not a pointer but a default. I have even tried specifying the style attribute in tag like style="cursor:pointer;" but that didn't work.

like image 332
Hawks Avatar asked Jun 08 '26 04:06

Hawks


1 Answers

Adding href="javascript:void(null);" to the area tag will do the trick.

like image 129
abhilashv Avatar answered Jun 10 '26 18:06

abhilashv



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!