create a custom button [closed]

@Larry Combs: Your question is poorly written for StackOverflow, but given that you have never posted a question here you may not fully know how this site is intended to be used. It is specifically for coding questions, but we’re not here to just write your code for you. You should post questions with examples of what you have tried and explicitly explain what the problem is. That being said, I’ll give you the benefit of the doubt this time.

Put this where you want your button to be:

<button id="target" type="button">Click Me</button>
<div id="output">0</div>

Put this before your closing </head> tag in header.php:

<script type="text/javascript>
    $(document).ready(function() {
        $('#target').click(function() {
            $('#output').html(function(i, val) { return val*1+1 });
        });
    });
</script>

Please see the Fiddle at the following link to see it in action: http://jsfiddle.net/Vg9mS/1/.

The code in the fiddle is credited to
Marcus Whybrow
.

Leave a Comment