<title>jQuery data() Method Set and Get Attached Data of the Selected Element</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
$(document).ready(function(){
$('.setbtn').click(function(){
$("div").data("mywebsite", "Tutorialdeep");
$('.getbtn').click(function(){
var myvar = $("div").data("mywebsite");
<h2>jQuery data() Method Set and Get Attached Data of the Selected Element</h2>
<button type="button" class="setbtn">Click to Set Data</button> <button type="button" class="getbtn">Click to Get Data</button><br><br>