McSas
McSas

Reputation: 2244

How to make a double linked-list in javascript + html

I have a class called listaDoble, in a Javascript document. And I have another HTML document with a text field and 4 buttons: Next, Back, New. When I press the New button I put, onmouseclick="lista= newListaDoble();", but then I lose the reference to the object. Some help?

Upvotes: 0

Views: 784

Answers (1)

Alex Reitbort
Alex Reitbort

Reputation: 13696

declare your javascript variable as

 var lista = null;

before you assign value to it. Not in onclick handler but in the body of the page.

Upvotes: 1

Related Questions