<input type="submit" name="button" value="点击" οnclick="js()">
<span id="aa"> </span>
<script type="text/javascript">
function js(){
var c = new Array("first","second","third");
var i =Math.round((Math.random()*3));
document.getElementById("aa").innerHTML=c[i];
}
</script>
字符串分解
String str = "sdsd/xsdsd";
String[] temp = str.split("/");
for(int i =0; i < temp.length; i++)
{
System.out.println(temp[i]);
}