jeudi 30 juin 2016

Override/Shadow a javascript source with another source

I have an html file as below:

<html>
  <head>
    <title>abc</title>
  </head>
  <body>
    <p>
    abcd
    <p>
    efgh
    <a href = "#" id = "link"> Click me </a>
  </body>
<script src = "src1"></script>
<script src = "src2"></script>
</html>

The problem: Javascript from src1 is essential for desired functioning for <p> tags whereas Javascript from src2 is essential for desired functioning for <a> tag. However <a> tag works in desired way only if src2 is present and src1 is absent. Fortunately src2 does not affect <p>. So, I was wondering if its possible to shadow src1 for <a>?

Aucun commentaire:

Enregistrer un commentaire