0

I have a popup.html that looks like this

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <link type="text/css" rel="stylesheet" href="css/fbh-ui.css" />
    <script type="text/javascript" src="js/jq.js"></script>
    <script type="text/javascript" src="js/fbh-popup.js"></script>
</head>

<body style="width: 200px">
    <div id="fbh-main">
        <div id="fbh-popup-enabled"></div>
    </div>
</body>

And fbh-popup.js looks like this

$('#fbh-popup-enabled').html('test');

The JS should alter the content of the div but does not. I even tried a simple console.log('test') in the JS file and that didn't fire. I am at a loss.

hexacyanide
  • 88,222
  • 31
  • 159
  • 162
gdanko
  • 1,922
  • 4
  • 20
  • 31

1 Answers1

0

you have to write your code inside ready event callback

$(document).ready(function() {
  $('#fbh-popup-enabled').html('test');
});
Raghvendra Parashar
  • 3,883
  • 1
  • 23
  • 36