Javascript concatenate two variables with "--" : <p>I want to concatenate two variables. When i'm using alert getting this error message [object HTMLInputElement]--[object HTMLInputElement].</p>

<pre><code>    var Name = document.getElementById("thevoornaam");
    var DoB = document.getElementById("thedate");

    var catVar = Name + "--" + DoB;
    alert(catVar);
</code></pre>

<p>Could anyone please help me out.</p>
