c1hundred
05-16-2009, 01:54 PM
hi, what i want to do is this:
type something into a text field, if a div with a rel that is the same as the text field value show that div.
<script type="text/javascript">
function search() {
var search = document.getElementById('search').value;
var results = document.getAttribute('rel');
var resultsIf = results = search;
if (resultsIf = true){
results.style.display = "block";
}
</script>
</head>
<body>
<div rel="go" style="border:0;display:none;">hello there!</div>
<input type="text" id="search"><input type="button" onclick="search()">
cheers
type something into a text field, if a div with a rel that is the same as the text field value show that div.
<script type="text/javascript">
function search() {
var search = document.getElementById('search').value;
var results = document.getAttribute('rel');
var resultsIf = results = search;
if (resultsIf = true){
results.style.display = "block";
}
</script>
</head>
<body>
<div rel="go" style="border:0;display:none;">hello there!</div>
<input type="text" id="search"><input type="button" onclick="search()">
cheers