Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Insert span next to textbox using jquery

Tags:

jquery

I have a text box. i want to insert <Span>Invalid value</span> next to that text box using Jquery. Just like when we use validation,It will come next to textbox or else.

like image 917
Pankaj Avatar asked Apr 06 '10 11:04

Pankaj


2 Answers

$('input').append('<span>Invalid Value</span>');
like image 71
Ballsacian1 Avatar answered Oct 24 '22 02:10

Ballsacian1


Use after:

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

or insertAfter:

$('<span>Invalid value</span>').insertAfter('input:text');
like image 27
karim79 Avatar answered Oct 24 '22 01:10

karim79