I am calling an external js function that I was hoping could set this.href. When I call the function I pass this.href - append_url(this.href). Within the function I define some variables from the DOM and I am hoping to use them for this .href.
<a href="link.html" onClick="append_href(this.href)">link</a>
function append_href(href) {
var placename = document.datesform.placename.value;
var statecountry = document.datesform.state_country.value;
var state = document.datesform.country.value;
var sresults='&placename=' + placename + '&statecountry=' + statecountry + '&state=' + state;
this.href=href+sresults;
}
Can anyone tell me why the this.href is not working and I suspect is not even being recognized>
<a href="link.html" onClick="append_href(this.href)">link</a>
function append_href(href) {
var placename = document.datesform.placename.value;
var statecountry = document.datesform.state_country.value;
var state = document.datesform.country.value;
var sresults='&placename=' + placename + '&statecountry=' + statecountry + '&state=' + state;
this.href=href+sresults;
}
Can anyone tell me why the this.href is not working and I suspect is not even being recognized>