Please let me know as it doesn't work.
First, ask the user to enter characters and images within this frame.
<div id="editor" contentable="true"></div>
Trigger user to press this button after typing
<input type="buttun" onclick="add()">
Run jQuery to
function add(){
variable editor=$("#editor").val();
$.mobile.changePage($("#list-page"));
$("#list").append("<li>"+"<p>"+editor+"</p>/li>")
$("#list").listview('refresh');
};
Reflect user input in the list view below
<div data-role="page"id="list-page">
<ul data-role="listview" data-inset="true" id="list"></ul>
</div>
I'd like to do this, but even if I press the button, I can't move on.
Is there anything wrong with the code above?
The jQuery reference does not state that div
can use .val()
.You probably need to use .html()
.
© 2024 OneMinuteCode. All rights reserved.