Solved

$(this).html() problems

Posted on 2014-02-24
8
199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 82

Accepted Solution

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

Author Comment

by:joyacv2
ID: 39884347
hi,

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

Expert Comment

by:leakim971
ID: 39884353
let ee see what you tried
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 1

Author Comment

by:joyacv2
ID: 39884361
hi,

alert($(this).val())
0
 
LVL 82

Expert Comment

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

Author Comment

by:joyacv2
ID: 39884373
the first three lines
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39884376
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
ID: 39884394
hi,

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

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
Suggested Courses

626 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