add IDs and classes to crypto link list, add JS to prevent default clicking behavior
This commit is contained in:
41
app.js
41
app.js
@@ -47,3 +47,44 @@ document.getElementById("dogewall").addEventListener("click", function(){
|
||||
// Display alert to confirm the address was added to clipboard
|
||||
alert("DOGE address copied to clipboard");
|
||||
});
|
||||
|
||||
//
|
||||
// Display crypto QR code when link is clicked
|
||||
//
|
||||
// Prevent clicks on QR codes from functioning
|
||||
document.querySelector("#btc-qr-link a").addEventListener("click", function(event){
|
||||
event.preventDefault()
|
||||
});
|
||||
document.querySelector("#eth-qr-link a").addEventListener("click", function(event){
|
||||
event.preventDefault()
|
||||
});
|
||||
document.querySelector("#doge-qr-link a").addEventListener("click", function(event){
|
||||
event.preventDefault()
|
||||
});
|
||||
|
||||
// Watch for click on BTC QR code link
|
||||
document.querySelector("#btc-qr-link a").addEventListener("click", function(){
|
||||
console.log('BTC QR Clicked');
|
||||
// Hide all other QR codes
|
||||
|
||||
// Display BTC QR code
|
||||
|
||||
});
|
||||
|
||||
// Watch for click on ETH QR code link
|
||||
document.querySelector("#eth-qr-link a").addEventListener("click", function(){
|
||||
console.log('ETH QR Clicked');
|
||||
// Hide all other QR codes
|
||||
|
||||
// Display ETH QR code
|
||||
|
||||
});
|
||||
|
||||
// Watch for click on DOGE QR code link
|
||||
document.querySelector("#doge-qr-link a").addEventListener("click", function(){
|
||||
console.log('DOGE QR Clicked');
|
||||
// Hide all other QR codes
|
||||
|
||||
// Display DOGE QR code
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user