I'm trying to change the file-format of New Text Document to html.But the file-extension was changed and still it open as a .txt file.
Based on your comments you appear to have "Hide extensions of known file types" set.
This means that when you create a new text file you see:
This also means that when you rename the file all you are changing is the filename part, but not the extension. This means that Windows still treats the file as a text file rather than html file. What you have is a file called:
Turn off this option. Full details can be found here but you need to go to Folder Options and select the View tab. Then find the "Hide extensions for known file types" option and clear it:
Alternatively, if using notepad or some similar editor to edit the file, make sure that you are saving as type "All Files (.)", with the extension ".html", and save as "filename.html".