Good day to you! The question is of course stupid, but to my regret, I can not clearly formulate my question and ask for help from search engines.
For example, on the page, the n-th number of all sorts of different tags that we will fill with the text through the value and innerHTML attributes.
Question:
How to learn programmatically , through which attribute the tag is filled, through value or innerHTML ?
And immediately question number 2: In PHP, there is such an interesting thing as a variable, an example:
<?php $var1 = 'variable!111'; $vb = 'var1'; echo $$vb;//выведет variable!111 ?>
Is it possible to do something similar in JS, for example like this:
$prpt_of_el = 'innerHTML'; $var eec = document.getElementById('someEI'); alert(eec.$$prpt_of_el);//хотелось бы динамически обратиться к свойству элемента, тоесть $$prpt_of_el может принимать значение либо innerHTML либо value, в зависимости от значения $prpt_of_el
I really hope that I put it clearly enough so that you can give me a full answer.