开发者

is there a way to click on one link that trigger inline editing of another area (not where you clicked)

开发者 https://www.devze.com 2022-12-15 21:32 出处:网络
i want to click on a link that will cause another area to become editable (not the link that i click).is thi开发者_StackOverflows possible with jeditable?The plugin you are using JEditable monitors th

i want to click on a link that will cause another area to become editable (not the link that i click). is thi开发者_StackOverflows possible with jeditable?


The plugin you are using JEditable monitors the elements you've tagged with a specific class for the 'click` event and then enabled the editing of the element once you've clicked it.

You can easily fire the click event from another element like this:

$("a#click_to_edit").click(function(){
  $("#editme").triggerHandler("click");
  return false;
})

.

<p id="editme" class="editable_textarea">Some Text to Edit</p>
<a id="click_to_edit" href="#">click me to edit the paragraph above</a>
0

精彩评论

暂无评论...
验证码 换一张
取 消