javascript - Need to change text information related to video -


https://dl.dropboxusercontent.com/u/99737964/video%20online/sermonvideos.html

i new jquery, javascript , coding in general. have made media player can click on , have different videos appear in box, wondering how can make text appear right of video box display video title , information. have text appear now, not understand how previous text disappear after clicking on new video. check url see. help!

get source code site.

use .html() or .text() functions of jquery , give id or class element contain title , information of clicked video like:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script>    $(document).ready(function() {         $('.videos').click(function() {             var value = $(this).attr('title');            $('#myinfo').html(value); //this should trick or               $('#myinfo').text(value); //this should trick        })    }); </script> 

and html

<div class = "videos" title = "this information">video 1</div> <div class = "videos" title = "this information">video 2</div> <div class = "videos" title = "this information">video 3</div> <div class = "videos" title = "this information">video 4</div> <div class = "videos" title = "this information">video 5</div>  <div id = "myinfo"></div> 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -