Jump to content

Problem getting selection with Firefox 2.0


Thierry

Recommended Posts

I have this textarea with buttons above it to allow for text to get bold tags and everything.

In IE this works fine with CreateRange(); but in Firefox it doesnt work.

I tried to use document.getSelection(); instead but no results, anyone see what I am doing wrong??

 

var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
var text = document.selection.createRange().text;}else{
var text = document.getSelection();}
window.alert(text);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.