Here is an example of how to use cardTypeChange
to update your CVV label and placeholder:
1paypal.HostedFields.render({ /* ... */ }).then(function (hostedFieldsInstance) {2 var cvvLabel = document.querySelector('label[for="cvv"]'); // The label for your CVV field34 hostedFieldsInstance.on('cardTypeChange', function (event) {5 // This event triggers when a change in card type is detected.6 // It triggers only from the number field.7 var cvvText;89 if (event.cards.length === 1) {10 cvvText = event.cards[0].code.name;11 } else {12 cvvText = 'CVV';13 }1415 cvvLabel.innerHTML = cvvText;16 hostedFieldsInstance.setAttribute({17 field: 'cvv',18 attribute: 'placeholder',19 value: cvvText20 });21 });22});