I have a select with several data attributes...
<option data-content="news" data-type="list">News List</option>
Is there a way to get all the data-attributes in a variable?
Call data with no parameters
var dataObject = $('option').data();
console.log(dataObject);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<option data-content="news" data-type="list">News List</option>