March 3, 2013

Dynamically Replacing Content with Javascript and Links

Question by Kristopher Perovic

http://jsfiddle.net/bUjx7/42/

<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.js'>
</script>

<script type='text/javascript'>
$(document).ready(function () {
    $('.fieldreplace a').click(function () {
        $('#fieldmatch, .fieldgame').hide();
        var region = $(this).data('region');
        $('#' + region).show();
    });
});
</script>

I’m trying to make it so clicking one link will replace content in all the cells, and not, as it is, in just one cell.

Help?

Answer by Starx

You can replace the contends of all tds like?

$('#tableId td').html('content to update on all cells');

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!