如何使用jQuery更改asp按钮单击上的asp标签值 [英] how to change asp label value on asp button click using jquery

查看:80
本文介绍了如何使用jQuery更改asp按钮单击上的asp标签值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
自从过去8个小时以来,我一直在问一个简单的问题,但是没人能帮我解决问题
我在页面上有2个ASP控件
按钮
标签
当用户单击按钮时,标签值应更改为任何其他值,并且标签的默认值为"Label1"
我想使用jquery来实现此任务,我尝试了不同的方法,但没有任何反应,您可以在下面的注释中看到它们

hi all
since last 8 hours i am asking one simple question but no one could help me out
i have 2 asp controls on page
button
label
when user clicks button then label value should be changed to any other value and label has a default value of "Label1"
i want to achieve this task using jquery i have tried different things but nothing happened u can see them in comments below

<head>
<script type="text/javascript">
 $(document).ready(function() {
        $("#Button5").click(function() {
        $("#Label1").html = "change";
        //$("#Label1").innerHTML ="hello word";
            alert("Hello world!");
        });
        });
 // $(document).ready(function() {
       //if($("#Label1").html()=="Label"){
	 ///ll('Label1').innerHTML ="hello word"
	//"#Label1".html()=="l1";
		//$("#popupCon").css("opacity","0.7");
       //} 
       
        
    </script>
</head>


和警报功能正常运行
请帮助我
感谢


and alert function is working perfectly
please help me
thanks

推荐答案

(文档).ready( function (){
(document).ready(function() {


(" ).click(函数(){
("#Button5").click(function() {


(" #Label1").html = 更改" ; //
("#Label1").html = "change"; //


这篇关于如何使用jQuery更改asp按钮单击上的asp标签值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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