Reputation: 935
I have the following HTML element
<p class="story" contenteditable="true">This is a story.</p>
Now I want to put the element into edit mode via javascript. I assumed something like the following would work, but it doesn't
$('.story').click();
How can I manually put this element in edit mode (via javascript or any other way) without the user clicking on the element?
Upvotes: 0
Views: 207
Reputation: 12925
$('.story').focus(function(){
$(this).attr('contenteditable', 'true');
});
Upvotes: -1