if ($('div.text').text().length > 10)
or
if ($('div.text').html().length > 10)
Div elements don't have the value returned by val (), but they have text or html
and then you probably want to truncate the text like
var text = $('div.text').text();
text = text.substr(0,10) + '...';
$('div.text').text(text);