谁帮我写一段javascript,使实现把radio隐藏,并插入一个图片文件的功能
就是我要写一个js方法,做以下的事情,把下面那个radio隐藏掉,然后替换为radio_checked.gif这个图片文件,哪位仁兄帮我写这么一个方法可以吗
小弟js不太懂!
<input type= "radio " class=radiobutton name= "RADIO " ID= "RADIO " value= "02 " >
------解决方案--------------------用div吧,你说的也不全,给你一个参考吧
<script>
function del_create_Radio(){
var Div_Radio = document.getElementById( "Div_Radio ");
//Div_Radio.innerHTML = " ";
if(form1.select1.value== "1 ") {
//var radio = document.createElement( "radio ");
Div_Radio.innerHTML = " <input type=\ "radio\ " name=\ "B1\ " value=\ "B1\ "> 王军\n <input type=\ "radio\ " name=\ "B2\ " value=\ "B2\ "> 刘海 ";
}
else if(form1.select1.value== "2 ") {
Div_Radio.innerHTML = " <input type=\ "radio\ " name=\ "G1\ " value=\ "G1\ "> 杨红\n <input type=\ "radio\ " name=\ "G2\ " value=\ "G2\ "> 孙燕\n <input type=\ "radio\ " name=\ "G3\ " value=\ "G3\ "> 马媛媛\n ";
}
else {
Div_Radio.innerHTML = " ";
}
}
</script>
<form id= "form1 " name= "form1 " method= "post " action= " ">
<select name= "select1 " onchange= "del_create_Radio() " id= "select1 ">
<option selected= "selected "> </option>
<option value= "1 "> 男 </option>
<option value= "2 "> 女 </option>
</select>
<div id= "Div_Radio ">
</div>
</form>
------解决方案--------------------alert(document.getElementById( "RADIO ").outerHTML);
document.getElementById( "RADIO ").outerHTML= ' <INPUT TYPE= "image " SRC= " "> ';