Solved

$(this).html() problems

Posted on 2014-02-24
8
188 Views
Last Modified: 2014-02-24
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?
0
Comment
Question by:joyacv2
  • 4
  • 4
8 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
If it's an textbox use val() instead html()
0
 
LVL 1

Author Comment

by:joyacv2
Comment Utility
hi,

don't work, any other idea?
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
let ee see what you tried
0
 
LVL 1

Author Comment

by:joyacv2
Comment Utility
hi,

alert($(this).val())
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 82

Expert Comment

by:leakim971
Comment Utility
line that mean you get html() of a texbox?
0
 
LVL 1

Author Comment

by:joyacv2
Comment Utility
the first three lines
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
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
 
LVL 1

Author Comment

by:joyacv2
Comment Utility
hi,

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

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now