Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add tags to selection

Status
Not open for further replies.

guitardave78

Programmer
Sep 5, 2001
1,294
GB
I have this in IE and would like a way of doing it if it is firefox :)

Code:
function getSel(tag,id)
{
	if(document.all){
		var str = document.selection.createRange().text;
		document.getElementById(id).focus();
		var sel = document.selection.createRange();
		sel.text = "<" + tag + ">" + str + "</" + tag + ">";
	}else{
		alert("Only works in IE!!!")
	}
}

}...the bane of my life!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top