Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Coding Web · Pagină
- Widget Coding Web -Numara Caracterele Dintr-un Text !
- Postați ca Adrian Deaconu Actualizați Reveniți la mesajul nefinalizat Previzualizați Închideți
- ScriețiHTML
- Link
- <html>
- <body>
- <div id="widgt">
- <div id="fundal" style="background: url(https://2.bp.blogspot.com/-z-Lv4DBRba4/WMgM5kMTZGI/AAAAAAAABB8/ILz0RFtFe745sNLCBzTNHIThOnRRiozBwCLcB/s1600/dra.png); height: 400px; margin: 0 0; width: 580px;">
- <textarea cols="50" id="var" rows="4" style="height: 235px; margin-left: 25px; margin-top: 70px; max-width: 525px; min-width: 525px; min-height: 235px; max-height: 235px; width: 525px;">Introdu un text !</textarea>
- <br />
- <div id="demo" style="float: right; font-family: fantasy; font-size: 18px; margin-top: 27px;">
- </div>
- <script>
- function text()
- {
- var cars = document.getElementById("var").value;
- document.getElementById("demo").innerHTML = cars.length;
- }
- function poz()
- {
- if(document.getElementById("var").value.length <9)
- {
- document.getElementById("demo").style.marginRight ="40px";
- }
- else if(document.getElementById("var").value.length >9 && document.getElementById("var").value.length <99 )
- {
- document.getElementById("demo").style.marginRight ="38px";
- }
- else if(document.getElementById("var").value.length >99 )
- {
- document.getElementById("demo").style.marginRight ="33px";
- }
- }
- </script>
- <div id="b" onclick="text();poz();" style="background: url(https://4.bp.blogspot.com/-SofmtqNkch8/WmvN0sIczMI/AAAAAAAACLY/p1ObEzFU4moNrwiyVpfpE9_jzJhL7cyggCLcBGAs/s1600/bt.png); height: 50px; margin-left: 20px; margin-top: 20px; width: 200px;">
- </div>
- </div>
- </div>
- <div id="tct" style="background: url(https://1.bp.blogspot.com/-Se2aKa30wgQ/WMghX0WAjEI/AAAAAAAABCM/mIHHctdxMSstIHtVunWaFiOgSRMvbkVfQCLcB/s400/gt.png); float: right; height: 230px; margin-right: 20px; margin-top: -350px; width: 400px;">
- </div>
- </body>
- </html>
- Setările paginii
- Opțiuni
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement