Wikipedia:Tools/Browser tools/cross-browser/Search Wikipedia for highlighted text

This bookmarklet searches Wikipedia for highlighted text.

Description

This bookmarklet allows you to quickly search for a highlighted or entered term using a bookmark. The scripts support Mozilla/Mozilla Firefox, Opera and Internet Explorer.
Installation instructions
Add the following code to a bookmark:
javascript:(function(){q=document.getSelection(); if(!q){void(q=prompt('Wikipedia search:',''))}; if(q)location.href='http://en.wikipedia.org/w/wiki.phtml?search='+escape(q)})()

Usage

To use the bookmarklet, highlight a word or phrase on any page and click on the bookmark. Alternately, click on the bookmark and enter a word or phrase at the prompt. This script works in both Internet Explorer and Mozilla Firefox. To use it in Opera, you may want to add the bookmark to the personal panel.