2014-10-01 45 views
-2

上更改GET跨度值如何獲得跨度值onchange?

<div id='id2'><span>editable spane</span></div> 
+0

請換成可以理解的東西:) – 2014-10-01 13:59:25

+0

不明白你在問什麼。請更換 – laaposto 2014-10-01 13:59:35

+0

這一切都取決於'span'是如何編輯的(一般來說,你不能像輸入一樣輸入)。更多細節將受到歡迎。 – Shai 2014-10-01 14:04:09

回答

0

我明白,你想跨度可編輯和獲得的價值。

$('#id2 span').bind('click', 
     function(){ 
      $(this).attr('contentEditable',true); 
     }); 
$('#id2 span').bind('blur', 
      function(){ 
      $(this).attr('contentEditable',false); 
       var pp = $(this).text(); 
       alert (pp); 
     });