如何使用javascript更改客户端标签的单词? [英] How to change words for label in client side using javascript ?

查看:85
本文介绍了如何使用javascript更改客户端标签的单词?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我在onclienclick clien端点击事件中遇到了Mozilla firefox的问题

(即OnClientClick =返回AddDevice_ClientClick())



我调用函数



hi I have a problem with Mozilla firefox in onclienclick clien side click event
( i.e OnClientClick="return AddDevice_ClientClick()")

I call the function

AddDevice_ClientClick()
{
           document.getElementById("ctl00_ContentPlaceHolder1_lblmftop").innerText = "Add Device";
           document.getElementById("ctl00_ContentPlaceHolder1_lblmfptop").style.display ="inline";
 return false;
}





页面加载lblmfptop是display = none,在客户端点击事件中我必须显示=内联和在我写的另一个单词(即.innerText =添加设备)的文本都在客户端。这将在IE和Chrome中工作,但在火狐中它不起作用。请回复asap



Thanx

Aravind



in page load lblmfptop is display=none ,in client side click event i have to dispaly=inline and in that text i write another word(i.e .innerText="Add Device") all are in client side.this will work in IE and chrome but in fire fox it not work. pls reply asap

Thanx
Aravind

推荐答案

好吧,firefox don不支持innerText。

试试这段代码

Well, firefox don''t support innerText.
Try this code
if(document.all) 
{
     document.getElementById('element').innerText = "my text";
} else{
    document.getElementById('element').textContent = "my text";
}


你可以用jquery来支付这个



you can use jquery for this

AddDevice_ClientClick()
{


' #ctl00_ContentPlaceHolder1_lblmftop ')。text(' 嗨这是varma');
('#ctl00_ContentPlaceHolder1_lblmftop').text('Hi this is varma');


这篇关于如何使用javascript更改客户端标签的单词?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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