Marcell
Marcell

Reputation: 105

Changing permanently html values using javascript?

Is it possible to change a html value permanently via javascript? I'm accessing a local file.

These are my codes:

function switchPic(){
  top.topPage.activeDef = top.topPage.document.getElementById('h1');
  top.topPage.activeDef.href = "pic2.html";

}

Upvotes: 1

Views: 785

Answers (2)

Oded
Oded

Reputation: 499002

No, this is not possible.

Javascript in the browser is insulated from the local file system (sandboxed) for security reasons.

Upvotes: 0

jhurshman
jhurshman

Reputation: 6067

If by "permanently" you mean changing the HTML file (on the server), the answer is no, you cannot do that with client-side JavaScript.

Upvotes: 3

Related Questions