随机数随机数
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script type="text/javascript" src="http://www.cqbyw.org/js/jquery-1.3.2.min-vsdoc.js"></script> <script type="text/javascript"> $(document).ready(function() { //x上限,y下限 var x = 99; var y = 95; var rand = parseInt(Math.random() * (x - y + 1) + y); var o = document.getElementById("b"); o.value = rand; $("#b").html("").append("<div>" + rand + "</div>"); }) </script> </head> <body> <a id="b">bbb</a> </body> </html>