Копируя примеры
Jul. 24th, 2007 03:19 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
(пишу сюда, чтоб потом самому легче было искать)
Как скопировать пример в строку поиска:
Как скопировать пример в строку поиска:
<html><head>
<title>Examples → Text Field</title>
<style type="text/css">
.ex a:link, .ex a:visited {
text-decoration: none;
border-bottom: 1px dashed #666;
color: #666;
}
</style>
<script language="javascript">
function cp(obj) {
document.getElementById('what').value = obj.innerHTML;
} // function cp
</script>
</head>
<body>
<form><p>Search for <input type="text" name="what" id="what"></p>
<p class="ex">Examples:
<a href="#" onclick="cp(this); return false">apple</a>,
<a href="#" onclick="cp(this); return false">banana</a>,
<a href="#" onclick="cp(this); return false">cucumber</a></p>
</form>
</body></html>
А теперь пойдём на Яндекс, поглядим, как сделано у них.