JavaScript / JQuery - Show Default Text in Empty Elements
4683
£100(approx. $125)
- Posted:
- Proposals: 13
- Remote
- #78569
- Archived
♛ No.1 ★ Magento 1.9, 2 & 2.4 ★ Word Press ★ E-commerce Consulting ★ Front End Development ★ Agile Delivery ★ PHP ★ HTML ★ PSD to Responsive ★ PSD to Magento ★ SASS, LESS & GRUNT ♛ 5/5 Ratings
London
86905227476198768638005611958512568613576915702218855319138478042
Description
Experience Level: Intermediate
We need someone to write JavaScript function(s) which does the following:
1- Fill empty elements with a default text. Only elements with the attribute "isEditable" are checked and filled.
2- When a user clicks on an element which contains a default text, the default text must dissapear so that the user can enter own text.
3- When an element text is deleted again and it is empty, the default text must be shown again.
Suggestions:
1- Can this be done by jQuery and/or CSS?
2- Write javascript function(s) to achieve this?
Example:
Assume we have the following HTML string:
<html>
<span id="1" isEditable="true"></span>
<p id="2"></p>
<p id="3" isEditable="true"></p>
</html>
We want to fill the elements 1 and 3 with the default text "Default text...".
Only elements with the attribute "isEditable" must be checked and filled with the default text as following:
<html>
<span id="1" isEditable="true">Default text...</span>
<p id="2"></p>
<p id="3" isEditable="true">Default text...</p>
</html>
1- Fill empty elements with a default text. Only elements with the attribute "isEditable" are checked and filled.
2- When a user clicks on an element which contains a default text, the default text must dissapear so that the user can enter own text.
3- When an element text is deleted again and it is empty, the default text must be shown again.
Suggestions:
1- Can this be done by jQuery and/or CSS?
2- Write javascript function(s) to achieve this?
Example:
Assume we have the following HTML string:
<html>
<span id="1" isEditable="true"></span>
<p id="2"></p>
<p id="3" isEditable="true"></p>
</html>
We want to fill the elements 1 and 3 with the default text "Default text...".
Only elements with the attribute "isEditable" must be checked and filled with the default text as following:
<html>
<span id="1" isEditable="true">Default text...</span>
<p id="2"></p>
<p id="3" isEditable="true">Default text...</p>
</html>
F S.
0% (0)Projects Completed
3
Freelancers worked with
2
Projects awarded
40%
Last project
20 Jul 2011
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies