count characters and multiply the result with an variable

New Member
4 0 0


I need some help with my first shopify shop. I want to know where I have to copy/paste this javascript code:


$(document).ready(function() {
var text_max = $('#personalization').attr('maxlength');
$('#personalization_feedback').html(text_max + ' characters remaining');

$('#personalization').keyup(function() {
var text_length = $('#personalization').val().length;
var text_remaining = text_max - text_length;
$('#personalization_feedback').html(text_remaining + ' characters remaining');

------------------------HTML Code begin----------------------------------

<input id="personalization" rows="8" cols="30" maxlength="30">
<div id="personalization_feedback">30 characters remaining</div>

------------------------HTML Code end----------------------------------


How I get an result from an clicked button?


I want to count the characters and multiply them with the value of the button.


thanks in advance