With ... Do - multiple components lazarus / 21-General ---------------------------------------------------------------------- noszone · 2021-12-14 07:59 Hello, I am trying to use the code as below: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i with edit1,edit2 doif visible then visible:=falseelse visible:=true But Lazarus seeing only edit2. How can I use it in order to minify the code? ---------------------------------------------------------------------- Awkward · 2021-12-14 08:17 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i edit1.visible := not edit1.visible;edit2.visible := not edit2.visible; ---------------------------------------------------------------------- noszone · 2021-12-14 08:28 Thanks. ---------------------------------------------------------------------- winni · 2021-12-14 08:32 Hi! Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i with edit1,edit2 do .. edit1,edit2 is NOT an enumeration but for nested with. See https://wiki.freepascal.org/With Winni ---------------------------------------------------------------------- dbannon · 2021-12-14 10:40 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var    Ctrl : TControl;begin    for Ctrl in [Edit1, Edit2] do        Ctrl.Visible := not Ctrl.Visible;.... Davo ---------------------------------------------------------------------- noszone · 2021-12-15 11:21 Awesome guys D:.