What could i do using javascript &/or HTML to create something that compares words entered in text fields, and returns the number of similar words there are?
-
-
Answer:
i konw, i fixed them, but it won't work right. i have IE though
jkb3614 at Answerbag.com Visit the source
Other answers
This might work. I haven't tested it.: First, create the two text areas: <textarea id="a"></textarea> <textarea id="b"></textarea> Now make a javascript function: function compareTextareas(a, b){ var aV = document.getElementById(a).value.split(" "); var bV = document.getElementById(b).value.split(" "); var results = {}; for(var a in aV){ for(var b in bV){ if(aV[a] == bV[b]){ results[aV[a]] = aV[a]; } } } var words = ""; for(var word in results){ words += results[word] + " "; } alert(words); } Then simply call that function when you want to compare them.
EL1 2
Related Q & A:
- How do I remove a site from IIS7 using JavaScript?Best solution by Server Fault
- Which MIME type to compress? and what If I omit the `type` attribute from the HTML?Best solution by Webmasters
- What do I hook my amp up to?Best solution by Yahoo! Answers
- How do I text to a cell phone number?Best solution by ChaCha
- What do I do if I purchased something from a fake website?Best solution by babyandbump.momtastic.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.