By using’s services you agree to our Cookies Use and Data Transfer outside the EU.
We and our partners operate globally and use cookies, including for analytics, personalisation, ads and Newsletters.

  • Join the Best Unofficial Elementor Support forum

    Provide or get advice on everything Elementor and Wordpress, ask questions, gain confirmation or just become apart of a friendly, like minded community who love Wordpress and Elementor

    Join us!
elementor official

body onload javascript on HTML widget



New Member
I need to add the following code on HTML widget, but I don't know how to remove the <body> tag (already defined by Wordpress) without removing the load script (onload).
Can someone can help me, please?

Thank you


<script type="text/javascript">
    var ns = false;
    if (navigator.appName == "Netscape"){ns = true;
    var gwAddr = getQueryString("gw_addr");
    var mp_idx = getQueryString("mp_idx");
    var errorNum = getQueryString("error_num");
    var wg_display = getQueryString("wg_display");
    var ps_display = getQueryString("ps_display");
    var ft_display = getQueryString("ft_display");
    var ps_path = getQueryString("ps_path");
    var ft_path = getQueryString("ft_path");
    var free_time_login = 0;  /* 0:use default free time page, 1:use customized ftee time page.*/
    var free_time_page = "./free_time.html?mp_idx="+ mp_idx +"&gw_addr=" +gwAddr;
    var tos_display = 0;
function chkError(){if(errorNum != 0){document.error.submit();
function initTask(){ft_data_retention();
function actionUrl(){document.login.action = gwAddr +'/weblogin.cgi';
        document.error.action = gwAddr +'/webauth_error.cgi';
        document.error.error_num.value = errorNum;
        document.getElementById("mp_idx").value = mp_idx;
        document.getElementById("error_mp_idx").value = mp_idx;
        if(wg_display !=0){/*Get Walled Garden Data*/
            var getwalled = gwAddr+'/walled_garden.cgi?callback=getGeo';
        var gettos= gwAddr+'/dynamic_script.cgi?callback=getTOS';
        DynamicScript('get_tos_enable', gettos);
function TermsOfService(){if(tos_display == 1){document.getElementById("termsdiv").style.display = "block";
            /* Terms of Service URL */
            document.getElementById("termslink").innerHTML = "<span style=\"margin-left: 10px;\">I understand and accept the</span><a href=\"./terms_of_service.html\" target='_blank' style=\"padding-left:3px;\">Terms and Conditions</a>.";
    <body onload='initTask(); actionUrl(); chkError(); TermsOfService();'>
        <div id="wrapper" class="wrapper">
            <div class="content">
                <div id="form_wrappers" class="form_wrappers">
                    <form id="loginHotels" class="loginHotels activeHotels" name= 'login' action="" enctype="application/x-www-form-urlencoded" method="post" autocomplete="off">
                            <label>User Name :</label>
                            <input name="username" type="text" />
                            <span class="error">This is an error</span>
                            <label>Password :</label>
                            <input name="password" type="password" onkeyPress="checkKey(event);"/>
                            <span class="error">This is an error</span>
                    <div id="ft_data_retention" class="link"></div>
                    <div id="payment" class="link"></div>
                    <div id="free" class="link"></div>
                    <div id="termsdiv" class="textword"><span style="float:left;"><input type="checkbox" name="terms" id="terms" value="1" onclick="terms_changed(this)">  I accept the <u>Terms and Conditions</u></span><span id="termslink"></span>
                    <div class="bottom">
                          <input type="button" id="submit_button" disabled name="Submit"  value="Login" class="buttonBtoom" onclick="Termscheck()"/>
                          <div class="clear"></div>
                    <div class="clear"></div>
                        <input type="hidden" id="mp_idx" name="mp_idx" value=""/>
                <div class="clear"></div>
        <form name= 'error' action="" enctype="application/x-www-form-urlencoded" method="post" autocomplete="off" target="_blank">
          <input type="hidden" name="error_num" value="">
          <input type="hidden" id="error_mp_idx" name="mp_idx" value=""/>

Latest posts

Latest Resources

Other Elementor Resources

elementor official