I'm currently developing an webextension for Chrome and Fiferox. I'm loading some Html content using a get request and I need to change one of the inputs values in the HTML data response before insert in the DOM.
Here is a part of the relevant code:
var url = browser.extension.getURL("resources/forms/form-a.html");
$.get(url, function(data){
$(data).find("input[id='name:front']").val("New Value");
//Here the console output is NOT "New Value"
console.log($(data).find("input[id='name:front']").val())
$("#form-names").replaceWith($(data));
});
I hoping to change some inputs values before replacing the DOM content. Some ideas ??
Thanks in advance.
Here is a part of the relevant code
- is this your webextension?