j-da
j-da

Reputation: 188

What's wrong with this Jade data binding?

What's wrong with this Jade? Thanks.

input#a
h1= document.getElementById('a').value

The error given is blank.

Upvotes: 0

Views: 132

Answers (1)

Mike Causer
Mike Causer

Reputation: 8324

As Amberlamps suggests, you have to wait until the DOM is ready.

input#a
h1

//- presuming you are using jQuery
script
    $(function() {
        $('h1').html($('input#a').val());
    });

Upvotes: 1

Related Questions