Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
How to change color dynamically for specific text in val()
Ankush Rathod
Jul 25 2017 10:48 AM
260
Reply
How to change color dynamically for specific text in jquery val() function.
- I want to change color for specific text and below is my code;
$("#" + id).val("141"+ " " + "(Only 140 characters will be shown on Twitter)").css('color', 'red');
- I have implemented this code but red color has set for all text.
- I would like to set color red for "141" only.
- Also, I have tryed with different solution like, 1) using <span> tag for "141" text. 2) using append, But I'm not getting proper result.
- Please suggest me proper answer for this code.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
unable to get particular data from xml using jquery
Allow Vertical Selection in the web Grid