By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,958 Members | 1,462 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,958 IT Pros & Developers. It's quick & easy.

How to Create Range in Firefox

P: 15
[HTML]<div name="wenben" id="wenben">HighLight me and Click Button</div>
<input onClick="makeitbig()" type="button" value="make it big">
function makeitbig(){

if (navigator.appName=='Netscape')
{document.getSelection().execCommand("FontSize",fa lse,29);}

else {document.selection.createRange().execCommand("Fon tSize",false,29);}

After geting the selection, how to create range, because i need to exec command like the above example. But in Netscape, i don't know how to make it work
anyone help, thanks a lots
Oct 8 '08 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 16,027
Netscape is not Firefox. Don't use browser detection.

This link should help.
Oct 8 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.