How do I get the value of the data-cod element?
$(document).ready(function() {
$('.chatUsuariosLista').click(function() {
$("#para").val(this.id);
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><divid="1" data-cod="21321321" class="row chatUsuariosLista">Nome 1</div>
<div id="2" data-cod="54654655" class="row chatUsuariosLista">Nome 2</div>
<div id="3" data-cod="79879878" class="row chatUsuariosLista">Nome 3</div>
<br>
<input id="para" type="text" value="">
<input id="projeto" type="text" value="">