form method="post" name="login" action="">
验 证 码:input type="text" name="code" class="text code" /> img src="code.php" id="code" />
/form>
script type="text/javascript" src="js/code.js">/script>
//外部文件code.js设置局部刷新函数
function code () {
var code = document.getElementByIdx_x_x('code');
code.onclick = function () {
this.src='code.php?tm='+Math.random();
};
};
form method="post" name="login" action="">
验 证 码:input type="text" name="code" class="text code" /> img src="code.php" id="code" />
span id="update">点击刷新验证码/span>
/form>
script type="text/javascript" src="js/code.js">/script>
//外部文件code.js设置局部刷新函数
function code () {
var code = document.getElementByIdx_x_x('code');
var update = document.getElementByIdx_x_x('update');
update.onclick = function () {
code.src='code.php?tm='+Math.random();
};
};