site.attr('data-state', 'disabled');
Must be
site.data('state', 'disabled');
When an element is created, the attribute data-<value>can be used to initialize the data property, but after that you should use jQuery.data () to retrieve or modify the data.
$(el).data('<data-name>') , $(el).data('<data-name>', value) .
:
$('div').attr('data-state', $('div').attr('data-state') == 'enabled' ? 'disabled' : 'enabled')
Fiddle