Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
- <script type="text/javascript">
- d=document;
- function usun(co){
- elem=d.getElementById(co);
- if(elem.value!=""){
- for(i=1;i<=elem.value.length/5;i++){
- if(i!=1) elem.value=d.getElementById(co).value.replace(i+". ","\n");else elem.value=elem.value.replace(i+". ","");
- }elem.value=elem.value.replace(/\n\n/g,"");}
- }
- function usunKomen(co){
- elem=d.getElementById(co);
- for(i=1;i<=elem.value.length/5;i++){
- if(elem.value.indexOf("/*")!=-1){
- pocz=elem.value.indexOf("/*");
- kon=elem.value.indexOf("*/");
- wycinek=elem.value.slice(pocz,kon+2);
- elem.value=elem.value.replace(wycinek,"");
- }
- }
- }
- function czysc(co){
- elem=d.getElementById(co);
- elem.value="";
- }
- </script>
- <style type="text/css">
- #main{
- margin:0 auto;
- width:500px;
- }
- #buttons{
- width:500px;
- margin:0 auto;
- text-align:center;
- }
- </style>
- <title>Usuwanie liczb</title>
- </head>
- <body>
- <div id="main"><textarea id="txt" style="width:500px;height:200px;""></textarea>
- <div id="buttons"><input id="usL" type="button" value="Usuń liczby"/><input id="usK" type="button" value="Usuń komentarze" onclick="usunKomen('txt');"/><input id="clP" type="button" value="Czyść pole" onclick="czysc('txt');"/></div></div>
- <script type="text/javascript">
- d.getElementById('usL').onclick=function(){usun('txt');}
- d.getElementById('usK').onclick=function(){usunKomen('txt');}
- d.getElementById('clP').onclick=function(){czysc('txt');}
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment