Category : function

I wrote js input requirement control but my requireControl function every time return false. Where is the my error ? var name = requireControl(‘#name’,5); function requireControl(field,length) { var result = false; $(field).on(‘keyup’, function (e) { e.preventDefault(); var control = $(this).val().trim(); if(e.keyCode === 8) { if(control.length < length) { $(this).addClass(‘errorInput’); result = false; } else { ..

Read more

I wrote js input requirement control but my requireControl function every time return false. Where is the my error ? var name = requireControl(‘#name’,5); function requireControl(field,length) { var result = false; $(field).on(‘keyup’, function (e) { e.preventDefault(); var control = $(this).val().trim(); if(e.keyCode === 8) { if(control.length < length) { $(this).addClass(‘errorInput’); result = false; } else { ..

Read more

My Inputted Array is var userArray = [4, 7, 2, 8, 9, 10, 15, 5, 1, 6, 12]. My expected output is: var evenArray = [4,2,8,10,6,12] var oddArray = [7,9,15,5,1] var greaterNumbArray = [7,8,9,10,15,12] All values between 3 arrays- 4 2 8 10 6 12 7 9 15 5 1 7 8 9 10 15 ..

Read more

I’m starting studying React and I was following this YouTube tutorial of a TO DO LIST using React. https://www.youtube.com/watch?v=E1E08i2UJGI My form loads perfectly, but if I write something and press any button I get the message: "completedTask is not a function". The same goes for buttons that call a function ‘removeTask’ and ‘setEdit’. I don’t ..

Read more

This function below allows a user to click on a menu item and have it displayed in a cart. I now want to add some code to give user access to delete items from the cart. Any suggestions how to do that? function addToCart(H,D,P){ document.getElementById(‘Cart’).innerHTML += document.getElementById(H).innerText + ‘ ‘ + document.getElementById(D).innerText + ‘<br>’ + ..

Read more