+ 1
How to give links to a button common in all pages using external css ?
I have multiple html pages and each page have some common buttons .. I want to declare a link for button in external CSS. so that I don't need to give links to each page separately.. any one know how to use CSS in this case .. Thanks in advance..
2 Antworten
+ 3
You should use JavaScript for that, not CSS.
<script>
//when the HTML charged
window.onload = function() {
//get an array with all the buttons
var butArray = document.getElementsByTagName('button');
//loop all the arrays position
for(var i=0;i<butArray.length;i++)
//assign the function to open the new link
butArray[i].onclick = function () {
window.open("example.com");
}
};
</script>
0
you should learn php for that so you can include html on all pages