Question: I would like to create a new column in my dataframe which is equal to the last business day of the month based on the US calendar, ideally in the format mm/dd/yyyy. My goal is to create this variable per day and set it for every day in the month corresponding to my existing `'DATES'` column. For example, for every day in January I want to create a a variable equal to `'01/31/2020'`, in a string format. For everyday in February I want to set a variable equal to `'02/28/2020'`, in string format.

If anyone has ideas would be of great help!

[Dataframe example](https://i.stack.imgur.com/n8eu1.png)

Answer: 
I made a function `searchLabel` for you!

```js
function searchLabel(inputElem) {
  var elem = inputElem;
  while (true) {
    if (elem.tagName == "LABEL") {
      break;
    }
    if (elem == null) {
      break;
    }
    elem = elem.previousSibling;
  }
  return elem;
}
console.log(searchLabel(document.getElementById("test2")));
```

```html
<div id="myDiv">
  <label for="test">Interval</label><br>
  <input min="0.1" id="test" placeholder="Min" step="0.1" type="number">
  <input min="0.1" id="test2" placeholder="Max" step="0.1" type="number">

  <label for="limit">Limit</label><br>
  <input id="limit" step="1" type="number">
</div>
```
You can find the nearest parent label element in the DOM using a little manual DOM traversal like so:

```js
function nearestParentLabel(inputId) {
  let input = document.getElementById(inputId);
  let label = input.previousSibling;
  while (label != null && label.tagName != "LABEL") {
    label = label.previousSibling;
  }
  return label;
}

console.log(
  nearestParentLabel("test"), // returns "test" label
  nearestParentLabel("test2"), // returns "test" label
  nearestParentLabel("limit"), // returns "limit" label
);
```

```html
<div>
      <label for="test">Interval</label><br>
      <input min="0.1" id="test" placeholder="Min" step="0.1" type="number">
      <input min="0.1" id="test2" placeholder="Max" step="0.1" type="number">

      <label for="limit">Limit</label><br>
      <input id="limit" step="1" type="number">
</div>
```