简体   繁体   中英

scala Liftweb - retrieving content of tag

Im new to lift, so the problem is: I have a div and a textarea in it. I also have a button, and I want to get #code textarea content without refreshing page (actually, it isn't important) I tried googling a lot, but there is no answers for 4 pages :C Pls, help! <div lift="Snippet.button"> <textarea id="code"> xdxdxdxdxd xhere goes the code </textarea> <br /> <button class="btn btn-default" id="but"> Submit </button> <input type="hidden" id="hidden"> </div>

After some hours of parsing myself a lot of sites, i found something :

JE.ValById("#code") - returns value of textarea or any input

JsCmds.SetValById("#code", "test value") - sets vlaue to found element

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM