Skip to main content
improve formatting
Source Link
Tamil Selvan C
  • 20.3k
  • 12
  • 55
  • 72

I have this function:

function msj(str) { // display = document.getElementById("txt"); // DOM // nodo = document.createTextNode(str); // display.replaceChild(nodo,display.firstChild); $("#txt").html(str); // jQuery } 

}

The message is displayed here:

<div id="txt">Guess the number between 1 and 10</div> 

Then, I want to display the message into a input text form. Anyone knows how to do it?

Many thanks.

I have this function:

function msj(str) { // display = document.getElementById("txt"); // DOM // nodo = document.createTextNode(str); // display.replaceChild(nodo,display.firstChild); $("#txt").html(str); // jQuery 

}

The message is displayed here:

<div id="txt">Guess the number between 1 and 10</div> 

Then, I want to display the message into a input text form. Anyone knows how to do it?

Many thanks.

I have this function:

function msj(str) { // display = document.getElementById("txt"); // DOM // nodo = document.createTextNode(str); // display.replaceChild(nodo,display.firstChild); $("#txt").html(str); // jQuery } 

The message is displayed here:

<div id="txt">Guess the number between 1 and 10</div> 

Then, I want to display the message into a input text form. Anyone knows how to do it?

Many thanks.

Source Link

JQuery html string input box

I have this function:

function msj(str) { // display = document.getElementById("txt"); // DOM // nodo = document.createTextNode(str); // display.replaceChild(nodo,display.firstChild); $("#txt").html(str); // jQuery 

}

The message is displayed here:

<div id="txt">Guess the number between 1 and 10</div> 

Then, I want to display the message into a input text form. Anyone knows how to do it?

Many thanks.