Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<script>
function cnt(w,x){
var y=w.value;
var r = 0;
a=y.replace(/,/g,',');
a=a.split(',');
for (z=0; z<a.length; z++) {if (a[z].length > 0) r++;}
x.value=r;
}
</script>
<form name="myform">
<textarea rows="15" name="w" cols="45"
onkeyup="cnt(this,document.myform.c)"></textarea>
<br />Word Count: <input type="text" name="c" value="0" size="5"
onkeyup="cnt(document.myform.w,this)" />
</form>
<form method='post' name='form' id='form' action='' >
<input type='text' size='100' name='title' value='' maxlength='100' onKeyDown='textCounter(this.form.title,this.form.leght,100);' onKeyUp='textCounter(this.form.title,this.form.leght,100);' />
<input readonly type='text' name='leght' size='3' maxlength='3' value='100' />
</form>
<script>
function cnt(w,x){
var y=w.value;
var r = 0;
a=y.replace(/,/g,',');
a=a.split(',');
for (z=0; z<a.length; z++) {if (a[z].length > 0) r++;}
x.value=r;
var zapCount = 10;
if(a.length > zapCount){
alert("Stiga tolkova :)))))");
}
}
</script>
Благодаря многоGalli каза:Ето така за 10 запетаи.
Може и без алерт.Код:<script> function cnt(w,x){ var y=w.value; var r = 0; a=y.replace(/,/g,','); a=a.split(','); for (z=0; z<a.length; z++) {if (a[z].length > 0) r++;} x.value=r; var zapCount = 10; if(a.length > zapCount){ alert("Stiga tolkova :)))))"); } } </script>