开发者

Hide Radio Button but Show Label?

Hey guys I'm tryng to hide radio button while showing label image.

<span id="js" class='info'>
  <label><input type="radio" name="vote" value="0" size="<?php echo $row['id']; ?>" onclick="js(this.value, this.size);" /><img src="something.jpg"/></label>
  <br />No:
  <label><input type="radio" name="vote" value="1" size="<?php echo $row['id']; ?>" onclick="js(this开发者_JS百科.value, this.size);" /><img src="something.jpg"/></label>
 </span>

I know this requires jquery to be linked with my span's id "js" but don't know the javascript code for it. Any help?

Thanks


It's quite simple:

$('#js input[type=radio]').hide()


Just use:

$("#js input[type=radio]").hide();


Thanks guys! Following worked for me:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
       $("label input:radio").wrap('<label></label>').parent().hide();
</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜