The source code is as follows, for reference only, just copy it directly:
<script><br>function checkbox()<br>{<br>var str=document.getElementsByName("box");<br>var objarray=str.length;<br>var chestr="";<br>for (i=0;i<objarray;i )<br />{<br /> if(str[i].checked == true)<br /> {<br /> chestr = str[i].value ",";<br /> }<br />}<br />if(chestr == "")<br />{<br /> alert("Please choose a hobby first~!");<br />}<br />else<br />{<br /> alert("Your first choice is:" chestr);<br />}<br />}<br /></script>
Select your hobbies :
Diving
Running
Listen to music