Hello @kartik,
You can do it with IE 'sometimes' as I have done this for an internal application on an intranet which is IE only. 
Try the following:
function GetComputerName() {
    try {
        var network = new ActiveXObject('WScript.Network');
        // Show a pop up if it works
        alert(network.computerName);
    }
    catch (e) { }
}
It may or may not require some specific security setting setup in IE as well to allow the browser to access the ActiveX object.
Hope it helps!!
Thank you!!