whyvasup.blogg.se

How to search a web page for a phrase
How to search a web page for a phrase






how to search a web page for a phrase
  1. #How to search a web page for a phrase how to
  2. #How to search a web page for a phrase movie

Of course it might make sense to add a kind of empty class here that is only used for the sole purpose of searching for it. In this case when searching for the english text that class-name is “col-md-2”.

how to search a web page for a phrase

Just get all elements on the page that have a certain class-name (CSS-class). The solution is based on a rather simple idea. That method is explained in the following. On submitting the form the action to be performed is defined as executing the JavaScript-method “search”. It is a rather simple HTML-form that can be used to enter the search-string and to then submitting the form. Using Bootstrap for this it happended that the web page contains entries like the following (quite a lot of them): The webpage to be searched lists technical phrases in english language, gives a translation into german and adds a short explanation to each term. I am pretty sure it should be relatively easy to apply the solution to this on similar problems then.

how to search a web page for a phrase

The problem to solve can be best shown by example. (Edited : Please see comment in the comments section below on W3School.) Thus I ended up reading the W3School’s JavaScript Tutorial. But somehow this time I did not really find a satisfying answer with Google and did not want to bother anyone with this. Well, my usual solution to any JavaScript-related question is: Google or my colleague Fabian. Maybe the worst thing of all is that all this is happening during a fun project of mine and therefore – so to say – doing some JavaScript here was my free will. But anyway I will share my experiences in solving the above mentioned problem which is: “Search for some text in a HTML page and then jump to the first occurence of that text found.”

#How to search a web page for a phrase how to

Furthermore I see a really huge risk here that some of my collegues – those who really know how to code JavaScript – will be tearing this blog post apart.

#How to search a web page for a phrase movie

Probably I should start this blog post with a big disclaimer, because so far doing anything with JavaScript to me was like entering a world of pain (sorry, but the movie reference is a must).








How to search a web page for a phrase