d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Javascript/html Task With Clear Instructions. > 500fg Each
Add Reply New Topic New Poll
Member
Posts: 14,925
Joined: Jan 3 2008
Gold: 135,879.75
Apr 4 2019 09:12am
Edit: subtitle of this post should say "500 Fg" not "500 fg each"

1. Create a box of 1000px by 1000px where user can write in lines of text into the box.
2. User presses submit button.
3. All lines are indented by 2 spaces.

Example:

This is line 1.
This is line 2.

Output afer Submit:

__This is line 1.
__This is line 2.



This post was edited by kdog3682 on Apr 4 2019 09:14am
Member
Posts: 1,039
Joined: Jul 8 2008
Gold: 1,939.50
Apr 4 2019 03:31pm
Quote (kdog3682 @ Apr 4 2019 10:12am)
Edit: subtitle of this post should say "500 Fg" not "500 fg each"


This is a joke. This has to be a joke, right? Clear instructions, but unclear payment ;)

Do you want this in codepen.io ?

This post was edited by waraholic on Apr 4 2019 03:36pm
Member
Posts: 1,039
Joined: Jul 8 2008
Gold: 1,939.50
Apr 4 2019 03:52pm
html
Code
<form action="javascript:void(0);" onsubmit="indent()">
<textarea id="text"></textarea>
<br>
<input type="submit">
</form>


css
Code
textarea {
width: 1000px;
height: 1000px;
}


js
Code
function indent() {
let element = document.getElementById('text');
element.value = element.value.split('\n').map(item => ' ' + item).join('\n');
}
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll