点击单选按钮可以刷新div吗? [英] Is it possible to refresh a div on a radio button click?

查看:314
本文介绍了点击单选按钮可以刷新div吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有可能刷新div上的一个单选按钮,在该div内呈现?



我有这种情况;



使用jQuery,我需要刷新单选按钮上的div。单选按钮存在于需要刷新的特定div中。

>

到目前为止所做的所有研究,我看到的webPages / forums,他们都有一些应该刷新的div外的按钮示例。



我有类似的东西:

 < div class =abc> 

< ul class =typeA>
< li>< input name =regType34onclick =javascript:loadRegister('34',$(this).attr('data-title')); value =REGtype =radioid =34_1class =MyStyledata-title =regchecked =checked>
< label for =34_1style =background-position:0px -67px;>注册< / label>< / li>
< li>< input name =regType34onclick =javascript:loadGraph('34',$(this).attr('data-title')); value =GRAtype =radioid =34_2class =MyStyledata-title =gra> < label for =34_2>图< / label>< / li>
< / ul>
< / div>

当用户点击regType34时,是否有可能刷新整个divabc?

刷新意味着重新加载div的内容

($ {
$(input [name = regType34])。click(function(){
$(#abc) .html(你想在div刷新时显示的html);
})


Is it possible to refresh a div on a radio button click presented within that div?

I have this scenario;

Using jQuery,I need to refresh a div on a radio button click.And the radio button is present in that particular div that I need to be refreshed.

All the research that I have done so far, webPages/forums I've seen, they all have examples of buttons outside the div that is supposed to be refreshed.

I have something like:

<div class="abc">

    <ul class="typeA">
        <li><input name="regType34" onclick="javascript:loadRegister('34',$(this).attr('data-title'));" value="REG" type="radio" id="34_1" class="MyStyle" data-title="reg"  checked="checked">
        <label for="34_1" style="background-position: 0px -67px;">Register</label></li>
        <li><input name="regType34" onclick="javascript:loadGraph('34',$(this).attr('data-title'));" value="GRA" type="radio" id="34_2" class="MyStyle" data-title="gra"> <label for="34_2">Graph</label></li>
    </ul>
</div>

Is it possible that when user click on "regType34", complete div "abc" will get refreshed?

Refresh means reloading of the content of div

解决方案

Try this :
    $("input[name=regType34]").click(function(){
    $("#abc").html("html that you want to show on div refresh");
    })

这篇关于点击单选按钮可以刷新div吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆