KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Let’s say I have this markup: <div id="content"> <div id="firstP"><p>First paragraph</p></div> <div id="secondP"><p>Second paragraph</p></div> <div id="thirdP"><p>Third paragraph</p></div> <div id="fourthP"><p>Fourth paragraph</p></div> </div> I want to add a new <div> with jQuery and focus on this new element. .focus does not do anything. function addParagraph() { var html = "<div id=\"newP\"><p>New paragraph</p></div>"; $("#content").append(html); $("#newP").focus(); } Any idea why?
Tags (comma-separated)
Save Edits
Cancel