Click here to Skip to main content
15,885,875 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,



please give the suggestion how to create the span tag dynamically by using javascript i tried using DOM object but it is not working by taking the reference from one the link


http://www.ezineasp.net/post/Javascript-Create-Span-Using-Document-createElement.aspx[^]


the click event is not raising if use that code
Posted

1 solution

try this.. :)

JavaScript
function CreatSpan(){
        
        
            $("#DivSpan").append("Create Span dynamically..!!");


        
        }


HTML

HTML
<div id="DivSpan">


        </div>
        <a onclick="CreatSpan()">Create Span </a>


click on Create Span link and span will be generate dynamically, If you want more maipulations or doing else then tell me i'll get back to you.. :)
 
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