Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HTML
<!DOCTYPE html>


	<title>njfhdf
	
	
		$(document).ready(function(){
				var arr = []
				var arr = []

				$("#btn_add").click(function(){
					arr_val = $ ("#arr_val").val()
					arr.append(arr_val)

					for(key in arr)
					{
						value = arr[key]
						output(key + "=" + value);
					}
			})$("#arr_val").append(output).value;
		})
	


Word
	<br> 
	Meaning
	<br>
	Add to Dictionary
		<h1>My Own Dictionary</h1>
		Search Word
		Search
		Reset
	
					
		<table border="1"><thead>			<tr><th style="width: 20%">Word</th>			<th style="width: 20%">Meaning</th>		</tr></thead>		<tbody id="array_cont"></tbody>	</table>


What I have tried:

In Describe the problem
Posted
Updated 7-Aug-18 17:58pm
v2

1 solution

Quote:
I tried that one but it didn't work

This is not informative !
Your browser have a developer console which show you error messages and problems in JS.
First of all you should spend some time to learn properly html, JS and Jquery.
W3Schools Online Web Tutorials[^]
JavaScript Tutorial[^]
jQuery Tutorial[^]

Any html page is compound of a <header> and a <body>. This is html 101.
When you open a tag, you also must close it:
HTML
<title>njfhdf</title>

Js code should be enclosed in <script> tags
JS lines should end with ';'
JavaScript
arr_val = $ ("#arr_val").val();
arr.append(arr_val);

Declaration of a variable must be done only once:
JavaScript
var arr = [];
var arr = []

Each one of those is enough to have a 'not work'.
And I have not even tried to see what your code is supposed to do.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900