<script> var img_r = new Image(); img_r.src = "2.png"; function img_size(val){ var kartinka = document.getElementById("kartinka"); kartinka.src = img_r.src; var img = new Image(); img.onload = function() { kartinka.src = this.src }; switch(val){ case "0": img.src = "img/2.png"; break; case "00": img.src = "img/3.png"; break; case "135": img.src = "img/4.png"; break; } } </script>
<script> var img_r = new Image(); img_r.src = "http://starlexx.com/Touareg/2.png"; function img_size(val){ var kartinka = document.getElementById("kartinka"); kartinka.src = img_r.src; var img = new Image(); img.onload = function() { kartinka.src = this.src }; switch(val){ case "2": img.src = "http://starlexx.com/Touareg/img/4.png"; break; } } </script>
<input type="radio" value="2" onclick="img_size(this.value)"/> <img id="kartinka" src="http://starlexx.com/Touareg/img/2.png" align="right" border="0"/>
<script> var img_r = new Image(); img_r.src = "http://starlexx.com/Touareg/2.png"; function img_size(data-url){ var kartinka = document.getElementById("kartinka"); kartinka.src = img_r.src; var img = new Image(); img.onload = function() { kartinka.src = this.src }; switch(data-url){ case "2": img.src = "http://starlexx.com/Touareg/img/4.png"; break; } } </script>
<input type="radio" url="2" onclick="img_size(this.url)"/> <img id="kartinka" src="http://starlexx.com/Touareg/img/2.png" align="right" border="0"/>
this.url
<input type="radio" data-url="2" />