title: How to get class of the element in stimulus.js
body: <p>I want to toggle elements and I need a class names for that.
  How can I get a class name of the nested element in stimulus.js and change it?
  F.I, I need to toggle the "ul" element that is initially hidden.</p>
  
  <pre><code>div data-controller="my_controller"
    a data-action="click-&gt;my_controller#toggle_my_elements"
      | Click
    ul.is-hidden id="my-id" data-target="my_controller.mytext"
      li
        | Text to be toggled.
  
  </code></pre>
  
  <p>and in stimulus controller I have:</p>
  
  <pre><code>import { Controller } from 'stimulus'
  
  export default class extends Controller {
    static targets = ["mytext"]
    toggle_my_elements(){
      console.log("debuggin")  //Ok
      const class_name = this.mytextTarget.className
    }
  }
  </code></pre>
  
  <p>I tried to call a js function <code>className</code> but it seems js functions don't work in the way they used to.
  I just can't figure out how to get it.</p>