How do I adjust the length of a string when I've clicked on it? Without complicating the entire code.
Something like strlen in php would be the solution.
See: // This
var toggleState = true;
$(document).ready(function() {
$('.more').on("click", function() {
if(toggleState) {
$(this).length(unlimited characters); // This
} else {
$(this).length(100 characters); // This
}
toggleState = !toggleState;
});
});
.length(unlimited characters) is just so that you understand what I mean/what I want to do. I need a solution, doesnt have to be length();