Haren Sarma
Haren Sarma

Reputation: 2553

My Javascript giving syntax error

My Javascript code is giving syntax error, I am unable to find where is the problem:

<script type="text/javascript">
   function display(id,type){
    alert("Hi");    
   }
</script>

onclick event is given below:

<map name="Map" id="Map">
  <area shape="rect" coords="24,165,133,182" href="#" onclick="display("#td1","show")" />
  <area shape="rect" coords="23,190,167,209" href="#" />
  <area shape="rect" coords="23,218,165,235" href="#" />
  <area shape="rect" coords="22,242,165,261" href="#" />
  <area shape="rect" coords="23,268,164,286" href="#" />
</map>

Upvotes: -1

Views: 96

Answers (1)

S. Ferit Arslan
S. Ferit Arslan

Reputation: 199

change quote to single quote

<area shape="rect" coords="24,165,133,182" href="#" onclick="javascript:display('#td1','show')" />

Upvotes: 2

Related Questions