Hello!
I am interested in the following question: How can js be used to display any information, but so that this information flies from JS, and not just show, for example, a div that has a display class: none ;? I, for example, derive, just in this way:
<input type="text" class="input-number"> <p style="display:none;" id="elem">Привет! Меня показывают и скрывают!</p> Js:
$('.input-number').change(function() { $("#elem").fadeIn('slow'); setTimeout("$('#elem').fadeOut();", 2000); }); Here is an example - link
But this is displayed by adding a div on the site with the class display: none ;. So would not really want to. Is it possible to somehow generate JS for example? Like that:
var tekst = '<p style="position:fixed;top:20px;right:20px;">Привет! Меня показывают и скрывают!</p>'; Those. write information to a variable and output it in the same way by changing the value in the input field. About this information is not found.
You can, of course, use the link , but again you must have a hidden div in the layout.
<input type="text" class="input-number"> <div id="elem" style="display:none;"></div> Js:
$('.input-number').change(function() { var tekst = '<p id="elem2" style="position:fixed;top:20px;right:20px;">Привет! Меня показывают и скрывают:)</p>'; $('#elem').html(tekst).fadeIn(); setTimeout("$('#elem').fadeOut();", 2000); }); I hope for your help :)