What is the difference when using Javascript’s .value? [on hold]

Example: var a = document.getElementById(“my-input”).value; Or var a = document.getElementById(“my-input”); var b = a.value; Sometimes, when I use the former, (like when I answered a previous question here), it does not work when used in conditional statements, and I had to use the latter to get the solution to work. Question Why does function myfunction()…

Promise { pending }, async, await in Javascript

I’m trying to understand why this code returns “Promise { pending }”. const reduceDirections = (str) => { str = str.replace(/northsouth|southnorth|eastwest|westeast/ig, ”) if (str.search(/northsouth|southnorth|eastwest|westeast/ig) === -1) { str = str.replace(/south|north|west|east/gi, ‘$& ‘).replace(/(^\s+|\s+$)/,”) console.log(str) return str } else { reduceDirections(str) } } async function start(arr) { str = arr.join(”) let res = await reduceDirections(str) return Promise.resolve(res)…

Is it possible to give a class and title lowercase letters with JQuery or JavaScript?

Is it possible to give a class and title lowercase letters with JQuery or JavaScript? I have this code: <span class=”status-source sources-detailed-” title=””></span> And you see this when you look at the website with element inspection: <span class=”status-source sources-detailed-Phone” title=”Phone”></span> I want everything to be lowercase, so like this: <span class=”status-source sources-detailed-phone” title=”phone”></span> I searched…