How to pass the value entered by the user in div contentable="true"

Asked 5 months ago, Updated 5 months ago, 15 views

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();

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>

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?

jquery html5

2022-09-30 14:15

1 Answers

The jQuery reference does not state that div can use .val().You probably need to use .html().

2022-09-30 14:15

If you have any answers or tips

© 2023 OneMinuteCode. All rights reserved.