$(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?
 
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.