I'm trying to make an alert on a function load with the onload event. It's easy but it does not work because I'm not. Code:
function inicia(){
alert("hola");
}
<body onload="inicia()">
<table style="width:50%" border="1" text-align="right">
<tr>
<th>Producte</th>
<th>Preu</th>
<th>Quantitat en magatzem</th>
<th>Compra</th>
</tr>
<tr>
<td>Televisor</td>
<td align="right">500</td>
<td align="right" id="quantitat_televisors"></td>
<td> <input type="text" id="compra_televisors" name="televisors" value="0"></td>
</tr>
<tr>
<td>Nevera</td>
<td align="right">400</td>
<td align="right" id="quantitat_neveres"></td>
<td><input type="text" id="compra_neveres" name="neveres" value="0"></td>
</tr>
</table>
<br/>
<input type="button" value="Factura" onclick="omple_cookies_compra();">
<input type="button" value="Reomple magatzem" onclick="reomple();">
<input type="button" value="Esborra cookies" onclick="esborraCookies();">
</body>