Need help with Javascript code, works on Desktop but not mobile

Job Description:

I have some Javascript code for a form input field. The code adds a '$' whenever click/focus on the input field, and also adds commas to properly format numbers (ex. $1,000,000).

The code works fine on desktop, but the '$' and commas do not work when I am on mobile device.

This is the code:

<input type="text" id="annual_salary" name="annual_salary" placeholder="Annual Salary" oninput="setCustomValidity('')" >


$('#annual_salary').on('keyup change focus click input paste',(function (event) {

$(this).val(function (index, value) {

return '$' + [login to view URL](/(?!\.)\D/g, "").replace(/(?<=\..*)\./g, "").replace(/(?<=\.\d\d).*/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");



var dollar1 = [login to view URL]('#annual_salary');

[login to view URL]('blur', function(e){

if ([login to view URL] == '$'){

[login to view URL] = '';




Attached are pictures of the described area.

Навыки: JavaScript, jQuery / Prototype, HTML, PHP, CSS

О клиенте:
( 61 отзыв(-а, -ов) ) Middle Village, United States

ID проекта: #35819929



i can help you to fix that right now Hi there ? How are you? This is Qandil I am a Web ? / Mobile ? developer, My resume [login to view URL] Having over 4 Больше

$20 USD за 1 день
(53 отзывов(-а))

13 фрилансеров(-а) готовы выполнить эту работу в среднем за $25


Hello Sir Hope you doing well I just checked your project details ✅✅ Need help with Javascript code, works on Desktop but not mobile ✅✅ and It matches my expertise. I have 14+ years of experience in this field. My sk Больше

$20 USD за 1 день
(468 отзывов(-а))

I am Carlos Monsalve specialist in graphic design, development of online stores, web software and websites. I have more than 9 years of experience in the IT and development area, I have a portfolio with more than 500 s Больше

$20 USD за 1 день
(51 отзывов(-а))

Hello! I’m Joseluis, I deliver high standard and outstanding service, good price and you get amazing satisfaction! I promise to do a great job on your project! No Stress. All the best.

$20 USD за 1 день
(35 отзывов(-а))

****Start immediately.**** I'm a professional web developer. I'm sure I will complete your project perfectly. Let's discuss more details in chat. thanks.

$50 USD за 1 день
(5 отзывов(-а))

Hello, I am excited to apply for this project and believe that my skills and experience make me the perfect fit. I am highly motivated and committed to delivering top-quality work. I am also available to start immediat Больше

$50 USD за 1 день
(2 отзывов(-а))

Hello, I am a proficient Javascript developer and I have solid experience with form, I can fix this in no time.

$20 USD за 7 дней(-я)
(2 отзывов(-а))

im pretty sure your problem may be caused by the fact that the code is using the jQuery library, which is not present on your mobile device. if you accept my proposal i will give you specific code and steps of how to e Больше

$20 USD за 1 день
(0 отзывов(-а))

HELLO, I found what you need !!!!!!!!! it appears that the issue is with the event listeners used in the JavaScript code. The code is using the events 'keyup', 'change', 'focus', 'click', and 'input' to trigger the for Больше

$20 USD за 1 день
(1 отзыв)

Seems a rather quick problem to solve. Looking forward to see more of it and get hands on the problem

$15 USD за 1 день
(0 отзывов(-а))