Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Google Docs
Each Attachment size should not exceed 1.0 MB.
Max no of attachments : 3
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
New to this Portal? Click here to
Sign up
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
jQuery
Plugins
UI
Meetups
Forum
Blog
About
Donate
All Forums
Recent Posts
Log In
Search
jQuery
Search
jQuery Forum
Move this topic
Forum :
Getting Started
Using jQuery
Using jQuery Plugins
Using jQuery UI
Developing jQuery Core
Developing jQuery Plugins
Developing jQuery UI
QUnit and Testing
About the jQuery Forum
jQuery Conferences
jQuery Mobile
Developing jQuery Mobile
Sub forum :
Move this topic
Cancel
Using jQuery
amic
Put value an get value of one div if is change
in
Using jQuery
•
10 years ago
Hi all,
how to get a value of a div when this change value?
example
<div id="count"> 0 </div>
Put value:
$('#count').val()=3
jQuery('#count').change(function() {
alert(jQuery(this).val());
}
Thanks, amic.
1
Replies(4)
jakecigar
Re: Put value an get value of one div if is change
10 years ago
Divs don’t get change events. Inputs and selects get change events.
You can
fake it
, however.
$('#count').change(function() { // when changed
alert($(this).text());
})
$('#count').text(3)
.trigger('change')
// set
JΛ̊KE
Leave a comment on jakecigar's reply
elearner26
Re: Put value an get value of one div if is change
10 years ago
.val functions on forms elements (input, textarea). HTML tag input has attribute value. Setting value=3 for input would add it for form element. $
(
"input"
).
val
(
text
);
div tag attributes does not include value?
http://www.w3schools.com/tags/tag_div.asp
Leave a comment on elearner26's reply
amic
Re: Put value an get value of one div if is change
10 years ago
And how to do with input?
Thanks, Jack.
Leave a comment on amic's reply
jakecigar
Re: Put value an get value of one div if is change
10 years ago
<input id=count>
$('#count').change(function() { // when changed
alert($(this).val());
})
$('#count').val(3) // set
JΛ̊KE
Leave a comment on jakecigar's reply
Change topic type
Topic Type :
Discussions
Questions
Ideas
Problems
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to amic's question
Top
Reply
{"z18724072":[14737000003362252,14737000003361713],"z2950240":[14737000003361609,14737000003361779],"z10019678":[14737000003361623]}
Statistics
4
Replies
1679
Views
1
Followers
Tags
Cancel
jquery put and get value
Actions
Permalink