TableScan Turbo Forums  

Go Back   TableScan Turbo Forums > General Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 08-10-2018, 12:58 AM
krishna mehra krishna mehra is offline
Senior Member
 
Join Date: Jun 2016
Posts: 194
Default How to get textbox value with jQuery

Hello folks,

I would like to know, How to get textbox value with jQuery ??


NATA Delhi | Architecture Aptitude Exam

Last edited by krishna mehra; 10-21-2019 at 12:15 AM.
Reply With Quote
  #2  
Old 08-10-2018, 11:57 PM
Randy Randy is offline
Senior Member
 
Join Date: Aug 2016
Posts: 137
Default

If you've got an input with an id of txtEmail you can use the following code to access the value of the text box:

$("#txtEmail").val()

You can also use the val(string) method to set that value:

$("#txtEmail").val("something")
Reply With Quote
  #3  
Old 08-13-2018, 12:37 AM
Lokesh Lokesh is offline
Senior Member
 
Join Date: Jun 2016
Posts: 115
Default

HTML Code :

<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-git.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>How to get the value of a textbox using jQuery</title>
</head>
<body>
<input type="text" value="Input text here">
</body>
</html>

avaScript Code :

$( "input" )
.keyup(function() {
var tvalue = $( this ).val();
console.log(tvalue);
})
.keyup();
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:59 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.