Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <a href="#">
- <div id="b1" class="button2">
- <span style="margin-left:5px; ">button 1</span>
- </div>
- </a>
- <a href="javascript:void(0)" id="b2">
- <div class="button"><span style="padding-right: 5px;"></span>button 2</div>
- </a>
- <script type="text/javascript">
- eval(var c = 0;
- $(document).ready(function() {
- $("#b1").on('click', function() {
- ++c;
- if (c > 15) {
- $(this).attr({
- href: "http://http://yahoo.com",
- target: "_self"
- });
- }
- });
- $("#b2").on('click', function() {
- if (c > 20) window.location = "http://bing.com";
- else window.alert("you will visit bing now " + c);
- });
- }););
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement