function ClickById(id) {
    var element = document.getElementById(id);

    if (element != null) {
        element.click();
    }
}

function ClickByClassName(classname) {
    var elements = document.getElementsByClassName(classname);

    if (elements != null) {
        if (elements.length > 0) {
            elements[0].click();
        }
    }
}