Jump to content

DOM input value not changing.


Millertime1

Recommended Posts

Hi, I'm having a problem with a hidden input value not changing on the browser after a request. I can change the value and alert or console log the new value but it won't change the DOM. Here's the section I'm having problems with:

xhr.onload = function() {
	if (xhr.status === 200) {
		var data = JSON.parse(this.responseText);
		$(".token").attr('value', data.token);
		alert($(".token").val());
	} else {
		console.log('Something went terribly wrong...');
	}
};
Link to comment
https://forums.phpfreaks.com/topic/290485-dom-input-value-not-changing/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.