在运行时在javascript中为标签赋值

在运行时在javascript中为标签赋值

本文介绍了在运行时在javascript中为标签赋值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Experts,

onkeyup function of a texbox i am checking that if username already exists or not in my database.
everything work fine when i tested it into a new application.
But when i am trying to use it into my actual application it doesn't work...

my actual page is a content page of a master page... and the code below:

<pre lang="Javascript"><script language ="javascript" type = "text/javascript">


    function OnSucceeded(result,userContext, methodName)
    {
        alert(result);
        var userarray=result;
        document.getElementById('lblerror').innerHTML=userarray;
        // Not working

    }
</script> </pre>

document.getElementById('lblerror').innerHTML=userarray;.... Line is not working i am not getting the .innerHTML property while typing...

help me to assing value of userarray into label lblerror...


Thanks...

推荐答案

document.getElementById('lblerror').innerText=userarray;






Or

document.getElementById('lblerror').textContent=userarray;



var lblerror = document.getElementById('<%= lblerror.ClientID %>');
           lbl.innerText = ' value changed';


这篇关于在运行时在javascript中为标签赋值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 10:11