<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>XYZ</title>
<style>
body,input{
text-align:center;
}
body{
margin:200px auto;
}
[type="button"]{
cursor:pointer;
width:100px;
}
</style>
<script>
function _(selector){return document.querySelector(selector);}
function __(selector){return document.querySelectorAll(selector);}
function getUrlVars(val) {
var vars={},
parts=val.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value){
vars[key]=value;
});
return vars;
}
onload=function(){
[].forEach.call(__('[type="text"]'),function(X){
X.onchange=function(){
/* http://flood.spam.com/index.php?cunt=1&boobs=2&PAGEN_1=1232 */
var val=this.value;
switch(true){
case this === _('[autofocus]') : if(val.indexOf('http://') == -1){_('[value="Сброс"]').click();}; break;
case this !== _('[autofocus]') && X !== _('[readonly]') : _('[readonly]').value=getUrlVars(_('[autofocus]').value)[val] || 'не найдено'; break;
default:;
}
}
});
_('[value="Сброс"]').onclick=function(){
[].forEach.call(__('[type="text"]'),function(X){X.value='';});
_('[type="text"]').focus();
}
}
</script>
</head>
<body>
<input type="text" size="100" autofocus placeholder="URL" />
<br /><br /><br />
<input type="text" size="30" placeholder="ПЕРЕМЕННАЯ" />
<input type="text" size="30" readonly placeholder="РЕЗУЛЬТАТ" />
<br /><br /><br />
<input type="button" value="Сброс" />
</body>
</html>