การเปิดใช้งานการเติมข้อความอัตโนมัติ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
นอกจากจะปรับแต่งสี แบบอักษร หรือรูปแบบลิงก์ในแผงควบคุมแล้ว
คุณสามารถเปลี่ยนรูปลักษณ์และลักษณะการทำงานของ
ช่องค้นหาผ่านแอตทริบิวต์ HTML ที่กำหนดเอง
ซึ่งจะช่วยให้คุณลบล้างการตั้งค่าทั่วไปบางอย่างจากแผงควบคุมได้
ซึ่งจะเป็นประโยชน์อย่างยิ่งเมื่อคุณต้องการช่องค้นหาเพียงช่องเดียว (เช่น ช่องค้นหาในหน้าแรก)
แสดงพฤติกรรมต่างจากอันอื่นๆ บนเว็บไซต์
ตัวอย่างเช่น คุณสามารถเปิดหรือปิดใช้ฟีเจอร์การเติมข้อความอัตโนมัติโดยใช้
enableAutoComplete
โดยค่าเริ่มต้นจะตั้งไว้เป็น
true
หากเปิดใช้งานการเติมข้อความอัตโนมัติในแผงควบคุม โดย
การเปลี่ยนค่าเป็น false
คุณสามารถควบคุมวิธีที่องค์ประกอบ
มีลักษณะเป็นอย่างไร
<!-- ใส่รหัส Programmable Search Engine ของคุณเองที่นี่ -->
<script async src="https://cse.google.com/cse.js?cx=017643444788069204610:4gvhea_mvga"></script>
<!-- ลองเปลี่ยนค่าแอตทริบิวต์เป็น "true" หรือ "เท็จ" -->
<div class="gcse-search" enableAutoComplete="true"></div>
หมายเหตุ: การเติมข้อความอัตโนมัติที่เปิดใช้งานหรือเพิ่มเข้ามาใหม่อาจใช้เวลาหลายชั่วโมงจึงจะปรากฏ
มีตัวเลือกอีกมากมาย คุณสามารถอ่านเกี่ยวกับช่องค้นหาอื่นๆ
ตัวเลือกการปรับแต่งใน
ส่วน Programmable Search Element Control API
สำหรับข้อมูลเพิ่มเติมเกี่ยวกับการเติมข้อความอัตโนมัติ โปรดดูที่บทความในศูนย์ช่วยเหลือเกี่ยวกับการเติมข้อความอัตโนมัติ
ถัดไป...
ไปที่การปรับแต่งผลการค้นหา
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eCustomize the search box's look, feel, and behavior using custom HTML attributes, overriding general Control Panel settings.\u003c/p\u003e\n"],["\u003cp\u003eControl individual search boxes differently, like enabling or disabling autocomplete for specific instances using the \u003ccode\u003eenableAutoComplete\u003c/code\u003e attribute.\u003c/p\u003e\n"],["\u003cp\u003eExplore additional search box customization options in the Programmable Search Element Control API documentation.\u003c/p\u003e\n"],["\u003cp\u003eNewly enabled or added autocompletions may require several hours to become visible.\u003c/p\u003e\n"],["\u003cp\u003eLearn more about Autocompletions in the dedicated Help Center article.\u003c/p\u003e\n"]]],[],null,["# Enabling Autocomplete\n\nApart from customizing colors, fonts or link style in the [Control Panel](https://programmablesearchengine.google.com),\nit is possible to influence the look and feel and the behavior of\nthe search box via custom HTML attributes.\n\nThis allows you to override some of the general settings from Control Panel.\nIt is especially useful when you want one search box (e.g. one on the homepage)\nto behave differently than other ones on the site.\nFor example, you can enable or disable autocomplete feature using\n`enableAutoComplete` attribute. By default, it is set to\n`true` if autocomplete is enabled in the Control Panel. By\nswitching the value to `false` you can control how the element\nbehaves. \n\\\u003c!-- Insert your own Programmable Search Engine ID here --\\\u003e \\\u003cscript async src=\"https://cse.google.com/cse.js?cx=017643444788069204610:4gvhea_mvga\"\\\u003e\\\u003c/script\\\u003e \\\u003c!-- Try switching the attribute value to \"true\" or \"false\" --\\\u003e \n\n \u003cdiv class=\"gcse-search\" enableAutoComplete=\"true\"\u003e\u003c/div\u003e\n\nNote: Newly enabled or added autocompletions may take several hours to appear.\n\nThere are many more options available. You can read about other search box\ncustomization options in\n[Programmable Search Element Control API](/custom-search/docs/element#supported_attributes) section.\n\nFor more information on Autocompletions, please see the [Help Center article](https://support.google.com/programmable-search/answer/2631081) on Autocomplete.\n\nNext...\n-------\n\nContinue to [Customizing search results](/custom-search/docs/tutorial/customizingresults)."]]