JavaScript Program to Create a Cookie and Setting expiration Time

Write a JavaScript program to create a cookie and setting expiration time.

Source Code
    <title>Set Cookie expiration time example</title>
        function setCookie() 
            var name = document.getElementById('person').value
            var expireDate = new Date()
            expireDate.setMonth(expireDate.getMonth() + 3)
            document.cookie = "name=" + name + "; expires="+expireDate.toGMTString()
        function readCookie() 
            var cookie = document.cookie
            var panel = document.getElementById('panel')

            if(cookie == "")
                panel.innerHTML = "Cookie not found"
                panel.innerHTML = cookie

<form name="myForm">
    Enter your name <input type="text" id="person"/><br/>
    <input type="button" value="Set Cookie" onclick="setCookie()"/>
    <input type="button" value="Read Cookie" onclick="readCookie()"/>
<p id="panel"></p>