jeudi 27 août 2015

My jQuery code is not creating new elements and displaying them to the page, how do I fix this?

<!doctype html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title>Remit</title>
        <link href="http://ift.tt/1K1B2rp" rel="stylesheet" type="text/css" media="screen"/>
        <link rel="stylesheet" type="text/css" href="style.css"/>
    </head>
    <body>
        <form>
            <div class="form-group">
              <textarea class="form-control status-box" placeholder="Your text here. . .?"></textarea>
            </div>
        </form>

         <div class="button-group pull-right">
            <a href="#" class="btn btn-primary">Post</a>
        </div>

        Unordered list

        <ul class="posts">
        </ul>

         <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
        <script src="app.js"></script>
        <script scr="script.js"></script>
    </body>
    </html>

====================jQuery starts here

    var main = function(){
        $('.btn').click(function(){
            var post = $('.status-box').val();
            $('<li>').text(post).prependTo('.posts');
        });
    };

    $(document).ready(main);

randomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtextrandomtext




Aucun commentaire:

Enregistrer un commentaire