As we often see in some sites, our search keywords are already selected in the site paragraphs.
same as those selection comes if we search something in browser( e.g. in crome ctrl+F)
how this can be achieved.
thanks,
As we often see in some sites, our search keywords are already selected in the site paragraphs.
same as those selection comes if we search something in browser( e.g. in crome ctrl+F)
how this can be achieved.
thanks,
There are two steps to this:
referer
property - in JavaScript, you can get it from document.referrer
(also see MDC page) (note the difference in spelling from the HTTP Header)- to see if the user arrived at your page from a search engine and then extract the search keywords. If you'd rather not work on this yourself, here are some pre-baked scripts you might be able to make use of:
Plain old JavaScript
jQuery