да, спасибо.
<Img id=myfoto width="150" height="300" style="position:absolute; top:100px; left:50px;" />
<form method="post" action="">
<input type="button" value="aa" onclick="te()"/></form>
<script type="text/javascript">
function te() {
document.getElementById("m").value = getrandom(1,3)
document.getElementById("text").innerHTML = document.R.elements[M.m.value].value
document.getElementById("myfoto").src="pho/"+M.m.value+".jpg"
}
function getrandom(min_random, max_random) {
var range = max_random - min_random + 1;
return Math.floor(Math.random()*range) + min_random;
}
</script>
<form method="post" name="R" action="">
<input type="hidden" name="r" />
<input type="hidden" name="r1" value="u"/>
<input type="hidden" name="r2" value="d"/>
<input type="hidden" name="r3" value="r" />
</form>
<form method="post" name="M" action="">
<input type="hidden" id="m" />
<div id="text"></div>
|