0
基本佈局:更新1個文本區域,經過多個環節
<textarea id="courseText"></textarea>
<ul class="chapter-items">
<li id="chap1link">Chapter 1</li>
<input id="chap1value" type="hidden" value="I am he as you are he as you are me and we are all together" />
<li id="chap2link">Chapter 2</li>
<input id="chap2value" type="hidden" value="See how they run like pigs from a gun, see how they fly" />
<li id="chap3link">Chapter 3</li>
<input id="chap3value" type="hidden" value="I'm crying" />
</ul>
是否有可能更新textarea的courseText每當李點擊與值與相應隱藏字段?
如果單擊了chap1link li,它會將chap1value的值加載到textarea上。
任何意見,將不勝感激。謝謝!
是的,這是可能用JavaScript。您可以將一個點擊事件附加到'li',並在該函數內設置'textarea'的值。 – Aiias 2013-03-10 07:43:22