0
if ($(input).attr('type') == 'email' || $(input).attr('name') == 'email') {
    if ($(input).val().trim().match(/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{1,5}|[0-9]{1,3})(\]?)$/) == null) {
        $(input).parent().css('content', "'Email không hợp lệ'");
        return false;
    }
}

How to change content this?

1

2

Zoli Szabó
  • 4,366
  • 1
  • 13
  • 19
haibq
  • 1
  • 1
  • 1
    Welcome to Stack Overflow! Please take the [tour], have a look around, and read through the [help], in particular [*How do I ask a good question?*](/help/how-to-ask) Please post code, error messages, markup, and other textual information **as text**, not as a *picture* of text. Why: http://meta.stackoverflow.com/q/285551/157247 – T.J. Crowder Aug 11 '21 at 16:15
  • Closely related: https://stackoverflow.com/questions/5041494/selecting-and-manipulating-css-pseudo-elements-such-as-before-and-after-usin (actually, it should be marked duplicate, silly of me to unmark it). – T.J. Crowder Aug 11 '21 at 16:16
  • 2
    Does this answer your question? [Selecting and manipulating CSS pseudo-elements such as ::before and ::after using javascript (or jQuery)](https://stackoverflow.com/questions/5041494/selecting-and-manipulating-css-pseudo-elements-such-as-before-and-after-usin) – Zoli Szabó Aug 11 '21 at 16:19
  • Please show code text as text, not as pictures of text. See [ask], where it says "**DO NOT post images of code, data, error messages, etc.** - copy or type the text into the question." (emphasis in the original). – Heretic Monkey Aug 11 '21 at 16:25

1 Answers1

0

The content: attr(data-validate) CSS line means that the value of the element's data-attribute property should be used as the content of the pseudo-element (::before). In consequence, you need to alter the value of the attribute:

$(input).parent().attr('data-validate', "'Email không hợp lệ'");
Zoli Szabó
  • 4,366
  • 1
  • 13
  • 19