W3C home > Mailing lists > Public > www-validator@w3.org > December 2016

Google searchbox is not validating as HTML5

From: Bigdata Sharma <10bigdata@gmail.com>
Date: Mon, 5 Dec 2016 16:10:33 +0530
Message-ID: <CAKMX_TEjPLuXcsPuouzNi7ogKuwM7u0d-X+hzpBqp4yq06zX_A@mail.gmail.com>
To: validator@w3.org, www-validator@w3.org
Hello sir,

Google searchbox is not validating as HTML 5. When I check this in the W3C
validator it shows an error : "element gcse:search not allowed as child of
element div in this context". How to solve it out.

The Code which I used is :--

<div id="searchbox">
    <script>
       (function() {
            var cx = '014531685129972083622:vk5kxnojpx0';
            var gcse = document.createElement('script');
            gcse.type = 'text/javascript';
            gcse.async = true;
            gcse.src = (document.location.protocol == 'https:' ? 'https:' :
'http:') + '//www.google.com/cse/cse.js?cx=' + cx;

            var s = document.getElementsByTagName('script')[0];

            s.parentNode.insertBefore(gcse, s);

        })();

    </script>
    <gcse:search> </gcse:search>
 </div>

Please Check it.


Yotan Chi
Webmaster at http://PrintableCalendarz.com
Boone County Public Library
1786 Burlington Pike Burlington, KY
Received on Monday, 5 December 2016 14:17:41 UTC

This archive was generated by hypermail 2.3.1 : Monday, 5 December 2016 14:17:44 UTC