I'm trying to create a simple text input box. When the submit button is pressed, the input in the text box is sent to a search script that compares the input to an array of possible values.

However, once I press the submit button, the correct result of the function flashes quickly on the screen, after which the default value of the text box returns, and the function result disappears quickly again. This all happens in a matter of like 100 ms. 

Could anyone explain how I can prevent this reset from happening? I've been looking online everywhere, and can only find people who are asking how to reset it, so I'm a bit confused as to what I'm doing wrong.

[Result after pressing submit](https://i.stack.imgur.com/58T1h.png)
[Result right after displaying the result](https://i.stack.imgur.com/mHvKT.png)
Body:

```
<body>
<div id="blogmenu"></div>

<div ID="RECEPT">
<h1>Search Bar</h1>
<br>

<h2> Time for Searchin' </h2>

<form name="inputForm">                                                                                                                                                                                
    <div><input type="text" min="1" max="50" value="" class="slider" id="a" name="a"></div>
    <div><input type="submit" onclick="SearchItem(document.getElementById('a').value);"></div>
</form>

<div ID="ijsjes" style="display:none"> IJsjes </div>

<div ID="spaghetti" style="display:none"> Spaghetti </div>

<div ID="gniocchi" style="display:none"> Gniocchi </div>

<div ID="bananen" style="display:none"> Bananen </div>

</div>

</body>

```

Function:

```
<script>

function SearchItem(Term) {

    console.log('I did get here');
    document.getElementById('a').value = Term;

    var ijsjes = {
        kleur : "wit",
        smaak : "zoet",
        type : "dessert"
    };
    var spaghetti = {
        kleur : "geel",
        smaak : "hartig",
        type : "pasta"
    };
    var gniocchi = {
        kleur : "geel",
        smaak : "hartig",
        type : "pasta"
    };
    var bananen = {
        kleur : "geel",
        smaak : "zoet",
        type : "fruit"
    };

    console.log(spaghetti.kleur + " also " + (spaghetti.kleur == Term));

    if (ijsjes.kleur == Term) {
        document.getElementById('ijsjes').style.display = 'block';
        console.log('ijsjes matched');
    } else {
        document.getElementById('ijsjes').style.display = 'none';
        console.log('ijsjes not matched');
    }

    if (spaghetti.kleur == Term) {
        document.getElementById('spaghetti').style.display = 'block';
        console.log('spaghetti matched');
    } else {
        document.getElementById('spaghetti').style.display = 'none';
        console.log('spaghetti not matched');
    }

    if (gniocchi.kleur = Term) {
        document.getElementById('gniocchi').style.display = 'block';
        console.log('gniocchi matched');
    } else {
        document.getElementById('gniocchi').style.display = 'none';
        console.log('gniocchi not matched');
    }

    if (bananen.kleur = Term) {
        document.getElementById('bananen').style.display = 'block';
        console.log('bananen matched');
    } else {
        document.getElementById('bananen').style.display = 'none';
        console.log('bananen not matched');
    }
}

</script>

```