This is a custom code placeholder.
Switch to Preview or publish the page
to see how your code works.
Double-click to edit
<div class="row">
<div class="btn-div-rec col-12-rec">
<button onclick="myFunction4()" class="btn-search-redirect">BOOK NOW</button>
</div>
</div>
<script>
function myFunction4() {
const searchUrl =
"/search-detail?dest_type=Other&dateRange=Sun%2C+Jan+12+25+-+Sat%2C+Jan+18+25&destination_id=1331262&latitude=36.114666&location=Las+Vegas%2C+Nevada%2C+United+States+of+America&longitude=-115.172874&paxConfig=%5B%7B%22room%22%3A1%2C%22adult%22%3A2%2C%22children%22%3A0%2C%22child%22%3A%5B%5D%7D%5D&search_type=4&searchall=true";
const previousURL = document.referrer;
const referrer = previousURL ? new URL(previousURL) : searchUrl;
var domain = referrer.origin + searchUrl.split("?")[0];
var search = searchUrl.split("?")[1];
const fullUrl = `${domain}?${search}`;
console.log("btn fullUrl", fullUrl);
window.location.href = fullUrl;
}
</script>
<style scoped>
.col-12-rec {
-webkit-box-flex: 0;
-ms-flex: 0 0 100%;
flex: 0 0 100%;
max-width: 100%;
}
.col {
-ms-flex-preferred-size: 0;
flex-basis: 0;
-webkit-box-flex: 1;
-ms-flex-positive: 1;
flex-grow: 1;
max-width: 100%;
}
.row {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
}
.btn-search-redirect {
width: 150px; /* change this attribute */
height: 30px; /* change this attribute */
background-color: rgb(11, 16, 80); /* change this attribute */
border-color: rgb(11, 16, 80); /* change this attribute */
font-family: Poppins; /* change this attribute */
font-weight: 700; /* change this attribute */
color: #ffffff; /* change this attribute */
font-size: 14px; /* change this attribute */
border-radius: 3rem;
transition-duration: 0.4s;
margin: 1rem;
cursor: pointer;
}
.btn-div-rec {
text-align: center;
}
</style>