how to connect buzzer in bolt chip and what is coding for that in js

how to connect buzzer in bolt chip and what is coding for that in js

use male to female jumper wires and connect the longer pin of the buzzer to 0 and shorter pin to ground and your hardware circuit is ready!
this is how malet to female jumper wires look like
male-to-female-jumper-wire-500x500|500x500
buzzer circuit connection.

//Javascript code to turn the buzzer on and off
<html>
<head>
<title> Buzzer test </title>
</head>
<body>
<button onClick=“onoff(“0”,“HIGH”)”>On</button>
<button onClick=“onoff(“0”,“LOW”)”>OFF</button>
<script type=“text/javascript” src=“https://cloud.boltiot.com/static/js/boltCommands.js”></script>
<script type=“text/javascript”>setKey(’{{ApiKey}}’,’{{Name}}’);</script>
<script>
function onoff(pin,state){
digitalWrite(pin,state);
}
</script>