Click here to Skip to main content
15,891,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi I have a problem with Mozilla firefox in onclienclick clien side click event
( i.e OnClientClick="return AddDevice_ClientClick()")

I call the function

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


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
Posted
Updated 14-May-13 23:01pm
v2

Well, firefox don't support innerText.
Try this code
JavaScript
if(document.all) 
{
     document.getElementById('element').innerText = "my text";
} else{
    document.getElementById('element').textContent = "my text";
}
 
Share this answer
 
Comments
Aravindba 23-May-13 0:13am    
hi thanx for ur reply ,your code is works in firefox,but in default i enable the underline for that label so ,when i run it show words with underline,but .textContent only show word but not underline ,pls reply me ,i want to show word with underline,pls reply asap

Thanx
Aravind
Mohibur Rashid 23-May-13 0:22am    
you are reading what is inside as text not html, try element.innerHTML;
you can use jquery for this

C#
AddDevice_ClientClick()
{
         $('#ctl00_ContentPlaceHolder1_lblmftop').text('Hi this  is varma');

  $('#ctl00_ContentPlaceHolder1_lblmftop').show();
        
 return false;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900