Web Development QA
Web Development QA
Q: What is HTML?
A: HTML (HyperText Markup Language) is the standard language for creating web pages and
applications.
Q: Define lists? Explain ordered and unordered lists with suitable examples.
A: Lists in HTML allow structuring content in a readable format.
Ordered List (<ol>): Items are displayed with numbers.
Unordered List (<ul>): Items are displayed with bullet points.
Example:
<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>
<ul>
<li>Item A</li>
<li>Item B</li>
</ul>
Example:
<form>
<input type='text' placeholder='Enter name'>
<button>Submit</button>
</form>
2. Internal CSS: Defined inside a <style> tag within the HTML file.
Example:
<style>
p {color: blue;}
</style>
Q: Explain the following Git commands: git status, git log, git push, git restore.
A: 1. git status: Shows the current state of the working directory.
2. git log: Displays the commit history.
3. git push: Pushes local commits to a remote repository.
4. git restore: Restores modified or deleted files.
Example:
document.addEventListener('keydown', function(event) {
console.log('Key pressed: ' + event.key);
});
Q: How does data exchange with a server using AJAX work? Provide an example program.
A: AJAX allows exchanging data without reloading the page.
Example:
fetch('https://api.example.com/data')
.then(response => response.json())
.then(data => console.log(data));
Example:
@Component({
selector: 'app-root',
template: '<h1>Hello Angular</h1>'
})
export class AppComponent {}