Insert span next to textbox using jquery

I have a text box. I want to insert <Span>Invalid value</span> next to this text box using jQuery. Just like when we use validation, it will appear next to the text box or otherwise.

+4
source share
2 answers

Use after :

 $("#myTextbox").after("<span>Invalid value</span>"); 

or insertAfter :

 $('<span>Invalid value</span>').insertAfter('input:text'); 
+9
source
 $('input').append('<span>Invalid Value</span>'); 
0
source

Source: https://habr.com/ru/post/1306112/


All Articles