creating two items in one panel lazarus / 76-Pas2JS ---------------------------------------------------------------------- mangakissa · 2020-06-17 14:23 I want to create two items in one panel. That's not a problem. 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 constructor TDemoform.create;begin  Panel  :=document.createElement('div');  Panel['class']:='panel panel-default';  item1 :=document.createElement('input');  item1['id']:='tekst1';  item1['type']:='text';  item2 :=document.createElement('input');  item2['id']:='tekst2';  item2['type']:='text';  document.body.appendChild(panel);;  Panel.appendChild(item1);  Panel.appendChild(item2);               When I run this code I see two text input items next to each other. If I create two items in HTML, tag
creates a new line after the first item. Is it also possible to do this in pas2js or do I have to create a panel for each item? I never build forms in javascript directly. ---------------------------------------------------------------------- PascalDragon · 2020-06-17 14:44 You should be able to simply do a br := document.createElement('br') and do a Panel.AppendChild(br) at the correct position you want. Though in general the idea is to use CSS for such things nowadays. ---------------------------------------------------------------------- mangakissa · 2020-06-18 06:37 Your right. It's just an element. Is it possible to make a CCS in lazarus? ---------------------------------------------------------------------- PascalDragon · 2020-06-18 07:24 Quote from: mangakissa on June 18, 2020, 08:37:32 amIs it possible to make a CCS in lazarus? Just create a CSS file and reference it from your HTML file? Alternatively you can also use inline styles. That is used extensively in Pas2JS_Widget like here. ---------------------------------------------------------------------- mangakissa · 2020-06-18 07:26 Never mind. I created an text file in the editor. Put some styles into it and saved to css. Then linked the stylesheet file into the html of the project. For me it has been a long time when i used js/html/css