$(this).html() problems

hi,

In this block of code:

	$(this).html('<form><input type="text" id="prueba" name="iniciales" value="'+$(this).html()+'"></form>');
		$(this).change(function(){
			
			alert($(this).html());
      alert($(this).attr("turnoAttr"));
	  alert($(this).attr("diaAttr"));
	  alert($(this).attr("filaAttr"));
	  alert($(this).attr("tipoTurnoAttr"));
			

Open in new window


i cannot get the value of the text that i write in the input box, how i can solve this?
LVL 1
joyacv2Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
leakim971Connect With a Mentor PluritechnicianCommented:
If it's an textbox use val() instead html()
0
 
joyacv2Author Commented:
hi,

don't work, any other idea?
0
 
leakim971PluritechnicianCommented:
let ee see what you tried
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
joyacv2Author Commented:
hi,

alert($(this).val())
0
 
leakim971PluritechnicianCommented:
line that mean you get html() of a texbox?
0
 
joyacv2Author Commented:
the first three lines
0
 
leakim971PluritechnicianCommented:
you CAN'T get html of a textbox, textbox have value
so your << first three lines >> are wrong

if you comment your code maybe I can help you doing what you want.

the first line say :
- put html of a textbox inside an other textbox wrapped by a form and put it inside the html of a textbox
0
 
joyacv2Author Commented:
hi,

using $("#prueba").val() solves the problem
0
All Courses

From novice to tech pro — start learning today.