Answers for "how to get siblings in javascript"

3

javascript get all classes

var allHiddenElements = document.getElementsByClassName("hidden");
Posted by: Guest on July-01-2019
0

how to get attr in vuejs

<script src="https://unpkg.com/vue"></script>

<div id="app">
  <my-comp my-attr="Any value"></my-comp>
</div>

<script>
  Vue.component('my-comp', {
    template: '<div>aaa</div>',
    created: function () {
      console.log(this.$attrs['my-attr']) // And here is - in $attrs object
    }
  })

  new Vue({
    el: '#app'
  })
</script>
Posted by: Guest on February-13-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language