开发者

passing variable to a function

its kind of silly question. but i dont know what mistake i am making. if any one could help.

<html>  
<head>  
<script type="text /vbscript">  
function zips(s)  
  document.write(s)  
end function   
</script>  
</head>  

<body>  
<script type="text/vbscript">  
 dim x,y  开发者_JAVA百科
 x="sushant"  
<button onclick="zips(x)" id=button1 name=button1>clickme</button>  
</script>  
</body>  
</html>  

sorry i dont know how to format it. but i am no getting the desired output. any help is very much appreciated


Your button tag should be outside of the script tag.

<script type="text/vbscript">  
 dim x,y  
 x="sushant"  
</script>  
<button onclick="zips(x)" id=button1 name=button1>clickme</button>  

The button is not part of the script but part of the HTML.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜