Click here to Skip to main content
15,920,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I am using Ifrmae in design mode and adding a span tag dynamically. So after adding the span i want o move my "Cursor" inside the span. so after inserting the span typed text will be inside the span.
How to do it using Java script or jquery.

XML
//Before inserting span tag.
<p>This is test </p>

//After inserting span tag.
<p>This is test </p>
<span style="background-color: #fafad2;"></span>//cursor have to be inside the span.
//So after inserting the span tag if we type some thing it will insert like below.
<p>This is test </p>
<span style="background-color: #fafad2;"> inserted test</span>

quick reply please. :(
Posted
Updated 25-Jan-11 6:11am
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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