2014-01-12 2 views
0

나는 스팬을 가지고 있으며 스팬은 컨텐츠 편집 가능합니다. 그래서 ... 스팬에서 ... 당신이 씁니다. 내가 스팬의 텍스트를 얻고 경고하기 위해 프로그램을 요청할 때가치를 얻은 후에 간격을 동일하게 유지하십시오.

Hello, 
My name is Ari. 

, 그것은 경고 :

"Hello,My name is Ari." 

는 간격, 또는 내가 넣어 들여 쓰기를 유지 그래서 그것을 얻는 방법 내용을 편집 할 수있는 범위. 내 프로그램이 대신

Hello, 
My name is Ari. 

뱉어 있도록 즉, 어떻게 그것을 얻을 수행하십시오 CSS 여기

<span id="thirdspan" contenteditable="true">Write context text here:</span> 

됩니다 : 여기

Hello,My name is Ari. 

는 HTML입니다

감사합니다.

+1

어떻게 스팬에서 텍스트를 경고하는 시도? JS 보여줘. – George

답변

0

이것은

<span class="output">Output Formatted Content</span> <div id="thirdspan" contenteditable="true" class="stuff" >Write context text here:</div>

$(document).ready(function(){ 
    $('span.output').click(function(){ 
     alert($('.stuff').html()); 
    }); 
    }); 
관련 문제